2020-03-28 12:42:32 +13:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
2020-03-30 06:26:45 +13:00
|
|
|
|
namespace SystemTrayMenu.DllImports
|
2020-03-28 12:42:32 +13:00
|
|
|
|
{
|
|
|
|
|
public static partial class NativeMethods
|
|
|
|
|
{
|
|
|
|
|
[DllImport("shell32.dll", SetLastError = true)]
|
|
|
|
|
private static extern IntPtr SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData);
|
|
|
|
|
|
2020-03-30 00:20:18 +13:00
|
|
|
|
internal static IntPtr Shell32SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData)
|
2020-03-28 12:42:32 +13:00
|
|
|
|
{
|
|
|
|
|
return SHAppBarMessage(dwMessage, ref pData);
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-30 00:20:18 +13:00
|
|
|
|
internal enum ABM : uint
|
2020-03-28 12:42:32 +13:00
|
|
|
|
{
|
|
|
|
|
New = 0x00000000,
|
|
|
|
|
Remove = 0x00000001,
|
|
|
|
|
QueryPos = 0x00000002,
|
|
|
|
|
SetPos = 0x00000003,
|
|
|
|
|
GetState = 0x00000004,
|
|
|
|
|
GetTaskbarPos = 0x00000005,
|
|
|
|
|
Activate = 0x00000006,
|
|
|
|
|
GetAutoHideBar = 0x00000007,
|
|
|
|
|
SetAutoHideBar = 0x00000008,
|
|
|
|
|
WindowPosChanged = 0x00000009,
|
|
|
|
|
SetState = 0x0000000A,
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-30 00:20:18 +13:00
|
|
|
|
internal enum ABE : uint
|
2020-03-28 12:42:32 +13:00
|
|
|
|
{
|
|
|
|
|
Left = 0,
|
|
|
|
|
Top = 1,
|
|
|
|
|
Right = 2,
|
|
|
|
|
Bottom = 3
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-30 00:20:18 +13:00
|
|
|
|
internal static class ABS
|
2020-03-28 12:42:32 +13:00
|
|
|
|
{
|
|
|
|
|
public const int Autohide = 0x0000001;
|
|
|
|
|
public const int AlwaysOnTop = 0x0000002;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
2020-03-30 00:20:18 +13:00
|
|
|
|
internal struct APPBARDATA
|
2020-03-28 12:42:32 +13:00
|
|
|
|
{
|
|
|
|
|
public uint cbSize;
|
|
|
|
|
public IntPtr hWnd;
|
|
|
|
|
public uint uCallbackMessage;
|
|
|
|
|
public ABE uEdge;
|
|
|
|
|
public RECT rc;
|
|
|
|
|
public int lParam;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
2020-03-30 00:20:18 +13:00
|
|
|
|
internal struct RECT
|
2020-03-28 12:42:32 +13:00
|
|
|
|
{
|
|
|
|
|
public int left;
|
|
|
|
|
public int top;
|
|
|
|
|
public int right;
|
|
|
|
|
public int bottom;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|