Win32:Hooking
lastmod 2015-09-16created 2015-09-161 edits
Mouse hooking
For mouse hooking, use WH_MOUSE_LL1 as the HOOK.
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, hInst, 0); // hook 설치
hMouseHook = SetWindowsHookEx(WH_MOUSE_LL, LowLevelMouseProc, hInst, 0); // hook 설치
// ...
void ShowMouse(HDC hdc)
{
TCHAR strM[256];
POINT pos;
GetCursorPos(&pos);//마우스 좌표를 알려주는 API
wsprintf(strM, L"X : %6d, Y : %6d", pos.x, pos.y);
}
References
-
For the keyboard,
WH_KEYBOARD_LL↩