热键

#include <Windows.h>

int APIENTRY WinMain(HINSTANCE hinstance,HINSTANCE hpreinstance,LPSTR cmdline,int mcmdshow)
{
    RegisterHotKey(NULL, 0x001, MOD_CONTROL, '1');
    MSG msg;
    while (GetMessage(&msg,NULL,0,0))
    {
        if (msg.message == WM_HOTKEY)
        {
            MessageBoxA(0, "即将退出", "确定", 0);
            exit(0);
        }
    }
}

 

posted @ 2016-01-18 11:46  喵小喵~  阅读(126)  评论(0编辑  收藏  举报