Code: Select all
CoordMode,mouse,Screen
hHookMouse := SetWindowsHookEx(WH_MOUSE_LL := 14, RegisterCallback("MouseHook", "Fast"))
return
esc::ExitApp
MouseHook(nCode, wParam, lParam){
VarSetCapacity(lpPoint,8)
,DllCall("GetCursorPos", "Ptr", &lpPoint)
,lx := NumGet(lpPoint, 0, "Int")
,ly := NumGet(lpPoint, 4, "Int")
,mx := NumGet(lParam+0, 0, "Int")
,my := NumGet(lParam+0, 4, "Int")
MouseGetPos,x,y
ToolTip % lx "," ly "`n" mx "," my "`n" x "," y ; mx/my is different from the others in 64bit Windows
CallNextHookEx(nCode, wParam, lParam)
}
SetWindowsHookEx(idHook, pfn)
{
Return DllCall("SetWindowsHookEx", "int", idHook, "Ptr", pfn, "Ptr", DllCall("GetModuleHandle", "Ptr", 0 ,"Ptr"), "Uint", 0, "Ptr")
}
CallNextHookEx(nCode, wParam, lParam, hHook = 0)
{
Return DllCall("CallNextHookEx", "Ptr", hHook, "int", nCode, "UPtr", wParam, "Ptr", lParam, "Ptr")
}