Answer the question
In order to leave comments, you need to log in
How to catch pressing CTRL+ALT+DEL (SetWindowsHookEx)?
Good day.
How to catch pressing CTRL+ALT+DEL?
I do it like this:
SetWindowsHookEx(WH_KEYBOARD_LL, ... ... ... )
...
int callHookProc(int nCode, DWORD wParam, DWORD lParam)
{
switch (wParam) {
case WM_KEYDOWN:
...
}
}
switch (wParam) {
case WM_KEYDOWN: {
KBDLLHOOKSTRUCT kbdStruct = *((KBDLLHOOKSTRUCT*)lParam);
if (kbdStruct.vkCode == VK_DELETE)
{
boolean b = bool( uchar(GetKeyState(VK_MENU)) >> 7 );
b = b && ( bool( uchar(GetKeyState(VK_LCONTROL)) >> 7 )
|| bool( uchar(GetKeyState(VK_RCONTROL)) >> 7 ) );
if (b) { QWinHook::m_This->call_taskmgr(); }
}
break;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question