Original Post
I wonder if anyone can tell me why I''m getting an error when I compile this code.
__declspec(dllexport) LRESULT CALLBACK KeyEvent(int nCode,
WPARAM wParam,
LPARAM lParam)
{
if(nCode==HC_ACTION)
{
KBDLLHOOKSTRUCT *hooked=(KBDLLHOOKSTRUCT *)lParam;
// Disable ATL+TAB
if (hooked->vkCode == VK_TAB && hooked->flags & LLKHF_ALTDOWN)
return 1;
// Disable ALT+ESC
if (hooked->vkCode == VK_ESCAPE && hooked->flags & LLKHF_ALTDOWN)
return 1;
// Disable the WINDOWS key
if (hooked->vkCode == VK_LWIN || hooked->vkCode == VK_RWIN)
return 1;
if (hooked->vkCode==VK_L && hooked->flags & LLKHF_ALTDOWN) //<---This is where the problem is.
MessageBox(NULL,"It works", "Does it work?", MB_OK);
//Add processing for alt+L for accessing password prompt
}
return CallNextHookEx(hKeyHook, nCode, wParam, lParam);
}
[source]
Is VK_L not a defined Virtual Key Code? If I replace it with 0x4C, then it is fine, but that is unreadable if I''m looking over it next week you know...