2017-11-27 13:11:20 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
// ReSharper disable FieldCanBeMadeReadOnly.Global
|
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
|
|
|
|
|
|
namespace Vanara.PInvoke
|
|
|
|
|
{
|
|
|
|
|
public static partial class User32
|
|
|
|
|
{
|
|
|
|
|
[Flags]
|
|
|
|
|
public enum HotKeyModifiers
|
|
|
|
|
{
|
|
|
|
|
MOD_NONE = 0,
|
|
|
|
|
MOD_ALT = 0x0001,
|
|
|
|
|
MOD_CONTROL = 0x0002,
|
|
|
|
|
MOD_SHIFT = 0x0004,
|
|
|
|
|
MOD_WIN = 0x0008,
|
|
|
|
|
MOD_NOREPEAT = 0x4000,
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-06 10:54:01 -05:00
|
|
|
|
[DllImport(Lib.User32, ExactSpelling = true, SetLastError = true)]
|
2017-11-27 13:11:20 -05:00
|
|
|
|
public static extern int RegisterHotKey(HandleRef hWnd, int id, HotKeyModifiers fsModifiers, uint vk);
|
|
|
|
|
|
2017-12-06 10:54:01 -05:00
|
|
|
|
[DllImport(Lib.User32, ExactSpelling = true, SetLastError = true)]
|
2017-11-27 13:11:20 -05:00
|
|
|
|
public static extern int UnregisterHotKey(HandleRef hWnd, int id);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|