1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
LRESULT CALLBACK KeyHook(int nCode, WPARAM wParam, LPARAM lParam){
    KBDLLHOOKSTRUCT *pk = (KBDLLHOOKSTRUCT*)lParam;
    if(nCode == HC_ACTION){
        switch(wParam){
            case WM_KEYDOWN:
            case WM_SYSKEYDOWN:
            case WM_SYSKEYUP:
            case WM_KEYUP:
                if(((pk->vkCode==0x09)&&(pk->flags=0x20))||//alt + tab
                ((pk->vkCode==0x1b)&&(pk->flags=0x20))||//alt + esc
                ((pk->vkCode==0x1b)&&(pk->flags=0x00))||//ctrl + esc
                ((pk->vkCode==0x73)&&(pk->flags=0x20))||//alt + f4
                ((pk->vkCode==0x09)&&(pk->flags=0x01))||//window + tab
                ((pk->vkCode==0x5b)&&(pk->flags=0x01))||//window + left
                ((pk->vkCode==0x5c)&&(pk->flags=0x01)))return 1;//window + right
        }
    }
    return CallNextHookEx(0, nCode, wParam, lParam);
}
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow){
    HHOOK hook;
    hook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyHook, hInstance, 0);
}
cs


'C&C++' 카테고리의 다른 글

How To Use Json In C++(jsoncpp)  (0) 2018.09.08
Get Window Focus On Other Window  (0) 2018.07.09
"" , L"" , TEXT("") , _T("")  (0) 2018.06.15
Using scanf() As gets()  (0) 2018.06.15
WINAPI GetClipboardData()  (0) 2018.05.17

+ Recent posts