1
2#include "stdafx.h"
3
4int _cdecl _tmain (
5 int argc,
6 TCHAR *argv[])
7{
8 if (RegisterHotKey(
9 NULL,
10 1,
11 MOD_ALT | MOD_NOREPEAT,
12 0x42)) //0x42 is 'b'
13 {
14 _tprintf(_T("Hotkey 'ALT+b' registered, using MOD_NOREPEAT flag\n"));
15 }
16
17 MSG msg = {0};
18 while (GetMessage(&msg, NULL, 0, 0) != 0)
19 {
20 if (msg.message == WM_HOTKEY)
21 {
22 _tprintf(_T("WM_HOTKEY received\n"));
23 }
24 }
25
26 return 0;
27}
28
29