Is there any way to use OnMessage(0x200, "WM_MOUSEMOVE") for Non-ahk window?
I'm trying to write a mouse gestures script, which needs to track the mouse movement.
Currently I'm using a timer, is there better ways?
[Solve] monitor mouse movement
[Solve] monitor mouse movement
Last edited by arcticir on 31 Jan 2014, 06:33, edited 2 times in total.
Re: monitor mouse movement
Why not study a mouse gesture script, here is a recent one http://ahkscript.org/boards/viewtopic.php?f=6&t=1197
Re: monitor mouse movement
Thanks. I already knew, including strokeit and StrokesPlus, but they can not meet my requirements.
Re: monitor mouse movement
I really think that you have to use a low level thing as "SetWindowsHookEx" with "WH_MOUSE_LL", with some search I guess some scripts are ready yet for autohotkey, it is a powerfull solution...
Also I guess it is possible but not elegant to have an elevated admin right script who attach each focused process to your current AHK script for to watch...
Good luck !
edit:else search "subclassing" or "attachthread" or how use a global mouse hook inserted into every process... but using your mousegetpos with a timer solution is enough if well coded...
Also I guess it is possible but not elegant to have an elevated admin right script who attach each focused process to your current AHK script for to watch...
Good luck !
edit:
Code: Select all
#Persistent
#SingleInstance Force
SetBatchlines -1
OnExit, UnHook
; http://msdn.microsoft.com/en-us/library/windows/desktop/ms644990.aspx , WH_MOUSE_LL
hHookMouse := DllCall("SetWindowsHookEx", "int", 14, "Uint", RegisterCallback("Mouse", "Fast"), "Uint", 0, "Uint", 0)
Return
UnHook:
DllCall("UnhookWindowsHookEx", "Uint", hHookMouse)
ExitApp
Mouse(nCode, wParam, lParam)
{
Critical
Tooltip, % (wParam = 0x201 ? "LBUTTONDOWN"
: wParam = 0x202 ? "LBUTTONUP"
: wParam = 0x200 ? "MOUSEMOVE"
: wParam = 0x20A ? "MOUSEWHEEL"
: wParam = 0x20E ? "MOUSEWHEEL"
: wParam = 0x204 ? "RBUTTONDOWN"
: wParam = 0x205 ? "RBUTTONUP"
: "?")
. " ptX: " . NumGet(lParam+0, 0, "int")
. " ptY: " . NumGet(lParam+0, 4, "int")
. "`nmouseData: " . NumGet(lParam+0, 10, "short")
. " flags: " . NumGet(lParam+0, 12, "uint")
. " time: " . NumGet(lParam+0, 16, "uint")
Return DllCall("CallNextHookEx", "Uint", 0, "int", nCode, "Uint", wParam, "Uint", lParam)
}
Esc::
ExitApp
Re: monitor mouse movement
Very grateful for your help.
Sorry I'm so late reply, it really helped me a lot!
Sorry I'm so late reply, it really helped me a lot!
Who is online
Users browsing this forum: inseption86, jaka1, LuckyJoe, metallizer, Rohwedder and 334 guests