| View previous topic :: View next topic |
| Author |
Message |
tuna
Joined: 03 Oct 2007 Posts: 47 Location: Bristol, England
|
Posted: Wed Mar 12, 2008 8:51 pm Post subject: Mouse move detection |
|
|
Is there a windows message that I can use that lets me know when the mouse moves on the screen. The detection must be for the whole screen, not just the gui like 0x200 WM_MOUSEMOVE.
Many thanks |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Thu Mar 13, 2008 8:13 am Post subject: |
|
|
MouseGetPos
CoordMode |
|
| Back to top |
|
 |
tuna
Joined: 03 Oct 2007 Posts: 47 Location: Bristol, England
|
Posted: Thu Mar 13, 2008 5:25 pm Post subject: |
|
|
| Thank Bobo, though I meant without the need of a timer - just catch a system message upon mouse movement |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2737 Location: Australia, Qld
|
Posted: Fri Mar 14, 2008 10:49 am Post subject: |
|
|
| Code: | #Persistent
MouseHook := DllCall("SetWindowsHookEx", "int", 14 ; WH_MOUSE_LL = 14
, "uint", RegisterCallback("MouseProc"), "uint", 0, "uint", 0)
return
MouseProc(nCode, wParam, lParam)
{
global MouseHook
Critical
if wParam = 0x200 ; WM_MOUSEMOVE
{
ToolTip % NumGet(lParam+0,0,"int") ", " NumGet(lParam+4,0,"int")
}
return DllCall("CallNextHookEx", "uint", MouseHook
, "int", nCode, "uint", wParam, "uint", lParam)
} | Windows 9x not supported. |
|
| Back to top |
|
 |
tuna
Joined: 03 Oct 2007 Posts: 47 Location: Bristol, England
|
Posted: Fri Mar 14, 2008 11:41 pm Post subject: |
|
|
Thanks, but that only works if the script gui is activated. Is there any way that the whole screen detection can work in the background?
Thanks |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2737 Location: Australia, Qld
|
Posted: Fri Mar 14, 2008 11:57 pm Post subject: |
|
|
I guess you didn't try the script, since it does indeed work when the script GUI is not activated. In fact, it does not even have a GUI.  |
|
| Back to top |
|
 |
tuna
Joined: 03 Oct 2007 Posts: 47 Location: Bristol, England
|
Posted: Sat Mar 15, 2008 1:48 pm Post subject: |
|
|
| Yes I did try it out, and that's what I thought too, since it doesn't need a gui to work. Now I think the problem is when I activate Notpad++ and left click, it seems to stop the detection process, and if I left click again on my primary monitor (I have 2), it starts the detection again. If I then click anywhere in Notepad++ on my secondary monitor it stops the process again until I then click on my primary monitor. Any ideas why? |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2737 Location: Australia, Qld
|
Posted: Sat Mar 15, 2008 3:28 pm Post subject: |
|
|
| Does it happen only with Notepad++? I guess Notepad++ is doing something that prevents the hook from working properly. I'm not sure anything can be done about that... |
|
| Back to top |
|
 |
NLI-C Guest
|
Posted: Sat Mar 15, 2008 7:30 pm Post subject: |
|
|
| Quote: | | Thanks, but that only works if the script gui is activated |
Uh, the script doesn't have a gui.  |
|
| Back to top |
|
 |
|