mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-09-28 23:31:25 +12:00
66 lines
1.7 KiB
C#
66 lines
1.7 KiB
C#
|
using System;
|
|||
|
using System.Runtime.InteropServices;
|
|||
|
|
|||
|
namespace SystemTrayMenu.NativeDllImport
|
|||
|
{
|
|||
|
public static partial class NativeMethods
|
|||
|
{
|
|||
|
[DllImport("shell32.dll", SetLastError = true)]
|
|||
|
private static extern IntPtr SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData);
|
|||
|
|
|||
|
public static IntPtr Shell32SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData)
|
|||
|
{
|
|||
|
return SHAppBarMessage(dwMessage, ref pData);
|
|||
|
}
|
|||
|
|
|||
|
public enum ABM : uint
|
|||
|
{
|
|||
|
New = 0x00000000,
|
|||
|
Remove = 0x00000001,
|
|||
|
QueryPos = 0x00000002,
|
|||
|
SetPos = 0x00000003,
|
|||
|
GetState = 0x00000004,
|
|||
|
GetTaskbarPos = 0x00000005,
|
|||
|
Activate = 0x00000006,
|
|||
|
GetAutoHideBar = 0x00000007,
|
|||
|
SetAutoHideBar = 0x00000008,
|
|||
|
WindowPosChanged = 0x00000009,
|
|||
|
SetState = 0x0000000A,
|
|||
|
}
|
|||
|
|
|||
|
public enum ABE : uint
|
|||
|
{
|
|||
|
Left = 0,
|
|||
|
Top = 1,
|
|||
|
Right = 2,
|
|||
|
Bottom = 3
|
|||
|
}
|
|||
|
|
|||
|
public static class ABS
|
|||
|
{
|
|||
|
public const int Autohide = 0x0000001;
|
|||
|
public const int AlwaysOnTop = 0x0000002;
|
|||
|
}
|
|||
|
|
|||
|
[StructLayout(LayoutKind.Sequential)]
|
|||
|
public struct APPBARDATA
|
|||
|
{
|
|||
|
public uint cbSize;
|
|||
|
public IntPtr hWnd;
|
|||
|
public uint uCallbackMessage;
|
|||
|
public ABE uEdge;
|
|||
|
public RECT rc;
|
|||
|
public int lParam;
|
|||
|
}
|
|||
|
|
|||
|
[StructLayout(LayoutKind.Sequential)]
|
|||
|
public struct RECT
|
|||
|
{
|
|||
|
public int left;
|
|||
|
public int top;
|
|||
|
public int right;
|
|||
|
public int bottom;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|