AutoHotkey Community

It is currently May 26th, 2012, 4:30 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Mouse move detection
PostPosted: March 12th, 2008, 9:51 pm 
Offline

Joined: October 3rd, 2007, 9:32 pm
Posts: 157
Location: UK
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 13th, 2008, 9:13 am 
MouseGetPos
CoordMode


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 13th, 2008, 6:25 pm 
Offline

Joined: October 3rd, 2007, 9:32 pm
Posts: 157
Location: UK
Thank Bobo, though I meant without the need of a timer - just catch a system message upon mouse movement


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2008, 11:49 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 12:41 am 
Offline

Joined: October 3rd, 2007, 9:32 pm
Posts: 157
Location: UK
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 12:57 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
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. :roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 2:48 pm 
Offline

Joined: October 3rd, 2007, 9:32 pm
Posts: 157
Location: UK
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 4:28 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
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...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 8:30 pm 
Quote:
Thanks, but that only works if the script gui is activated


Uh, the script doesn't have a gui. :shock: :? :?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], LazyMan, oldbrother and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group