S
steel
Hi, everyone, I am fighting with a project with 5 Hotkey registerd. but
when the VK code is 66 67 68 69 71, the WM_HotKey msg can not fired,
but if changed the VK code to 117 ... 121 , the Project runs well. I
have look up the MSDN, but get no answerns yet.Can anyone make me known
the reason?
I have found that when the Vitual KeyCode is 66-70, the system viewed
it as normal keyEvent, Not HotKey event.
the related code:
public enum KeysHardware : int
{
Hardware1 = 66, //117,//
Hardware2 = 67, //118,//
Hardware3 = 68, //119,//
Hardware4 = 69, //120,//
Hardware5 = 71 // 121 //
}
public static void RegisterRecordKey(IntPtr hWnd)
{
bool Ret;
Ret = UnregisterFunc1(KeyModifiers.None,
(int)KeysHardware.Hardware1);
Ret = RegisterHotKey(hWnd, (int)KeysHardware.Hardware1,
KeyModifiers.None, (int)KeysHardware.Hardware1);
Ret = UnregisterFunc1(KeyModifiers.None,
(int)KeysHardware.Hardware2);
Ret = RegisterHotKey(hWnd, (int)KeysHardware.Hardware2,
KeyModifiers.None, (int)KeysHardware.Hardware2);
Ret = UnregisterFunc1(KeyModifiers.None,
(int)KeysHardware.Hardware3);
Ret = RegisterHotKey(hWnd, (int)KeysHardware.Hardware3,
KeyModifiers.None, (int)KeysHardware.Hardware3);
Ret = UnregisterFunc1(KeyModifiers.None,
(int)KeysHardware.Hardware4);
Ret = RegisterHotKey(hWnd, (int)KeysHardware.Hardware4,
KeyModifiers.None, (int)KeysHardware.Hardware4);
}
any suggestions and solutions will be very appreciated.
when the VK code is 66 67 68 69 71, the WM_HotKey msg can not fired,
but if changed the VK code to 117 ... 121 , the Project runs well. I
have look up the MSDN, but get no answerns yet.Can anyone make me known
the reason?
I have found that when the Vitual KeyCode is 66-70, the system viewed
it as normal keyEvent, Not HotKey event.
the related code:
public enum KeysHardware : int
{
Hardware1 = 66, //117,//
Hardware2 = 67, //118,//
Hardware3 = 68, //119,//
Hardware4 = 69, //120,//
Hardware5 = 71 // 121 //
}
public static void RegisterRecordKey(IntPtr hWnd)
{
bool Ret;
Ret = UnregisterFunc1(KeyModifiers.None,
(int)KeysHardware.Hardware1);
Ret = RegisterHotKey(hWnd, (int)KeysHardware.Hardware1,
KeyModifiers.None, (int)KeysHardware.Hardware1);
Ret = UnregisterFunc1(KeyModifiers.None,
(int)KeysHardware.Hardware2);
Ret = RegisterHotKey(hWnd, (int)KeysHardware.Hardware2,
KeyModifiers.None, (int)KeysHardware.Hardware2);
Ret = UnregisterFunc1(KeyModifiers.None,
(int)KeysHardware.Hardware3);
Ret = RegisterHotKey(hWnd, (int)KeysHardware.Hardware3,
KeyModifiers.None, (int)KeysHardware.Hardware3);
Ret = UnregisterFunc1(KeyModifiers.None,
(int)KeysHardware.Hardware4);
Ret = RegisterHotKey(hWnd, (int)KeysHardware.Hardware4,
KeyModifiers.None, (int)KeysHardware.Hardware4);
}
any suggestions and solutions will be very appreciated.