28.热键

 1 #include <Windows.h>
 2 #include <stdlib.h>
 3 
 4 //                           自身的窗口句柄       父窗口句柄          命令           控制显示或者隐藏
 5 int APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE hpreinstance, LPSTR cmdline, int mcmdshow)
 6 {
 7     RegisterHotKey(NULL, 0x001, MOD_CONTROL, 'M');
 8     MSG msg;
 9     while (GetMessage(&msg, NULL, 0, 0))
10     {
11         if (msg.message == WM_HOTKEY)
12         {
13             if (msg.wParam == 001)
14             {
15                 keybd_event('M', 0, 0, 0);
16                 keybd_event('M', 0, 2, 0);
17             }
18             //exit(0);
19         }
20     }
21 }

 

posted @ 2018-01-17 19:59  喵小喵~  阅读(130)  评论(0)    收藏  举报