Thursday, March 13, 2008

How to get scan code and virtual code of hardkey?

//
// hook() -
//
LRESULT CALLBACK
hook(int nCode, WPARAM wParam, LPARAM lParam)
{

csError.Format(L"vkcode:%d,scancode:%d",((KBDLLHOOKSTRUCT*)lParam)->vkCode,((KBDLLHOOKSTRUCT*)lParam)->scanCode);
RecordErrMsg(csError);

switch((((KBDLLHOOKSTRUCT*)lParam)->vkCode))
{
...
}

return CallNextHookExMine(gInst, nCode, wParam, lParam);
}

No comments: