How to activate keys combination with hook ?
-
Hi To get the symbol @ for example, I must press two buttons at seem time [Alt Gr] + [button with a and 0 near the backspace button]. So actually my application didn't support keys combination, so when I press this combination I get letter 'a' instead of symbol '@'. I am using VCE 2008. Here is the function I am using :
LRESULT WINAPI EventKey(int nCode, WPARAM wParam, LPARAM lParam)
{
if( (nCode == HC_ACTION) && ( (wParam == WM_SYSKEYDOWN) || (wParam == WM_KEYDOWN) ))
{
kbdStruct = *((KBDLLHOOKSTRUCT*)lParam);
nChar = getKeyFromvcode(kbdStruct.vkCode, (PWCHAR)&outputChar, (PWCHAR)&deadChar);if(nChar > 0){/* Record the key*/}
}
return CallNextHookEx(hKeyHook, nCode, wParam, lParam);
}How can I tell the application to convert keys combinations to its associated letters or symbols ? Regards
-
Hi To get the symbol @ for example, I must press two buttons at seem time [Alt Gr] + [button with a and 0 near the backspace button]. So actually my application didn't support keys combination, so when I press this combination I get letter 'a' instead of symbol '@'. I am using VCE 2008. Here is the function I am using :
LRESULT WINAPI EventKey(int nCode, WPARAM wParam, LPARAM lParam)
{
if( (nCode == HC_ACTION) && ( (wParam == WM_SYSKEYDOWN) || (wParam == WM_KEYDOWN) ))
{
kbdStruct = *((KBDLLHOOKSTRUCT*)lParam);
nChar = getKeyFromvcode(kbdStruct.vkCode, (PWCHAR)&outputChar, (PWCHAR)&deadChar);if(nChar > 0){/* Record the key*/}
}
return CallNextHookEx(hKeyHook, nCode, wParam, lParam);
}How can I tell the application to convert keys combinations to its associated letters or symbols ? Regards
From your code snippet , it seems you are hooking keyboard to detect your combination you must check virtual key codes for ALT and other keys check msdn link http://msdn.microsoft.com/en-us/library/ms927178.aspx[^] and also search for key logger on code project