What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] WM_MOUSEMOVE doesn't work

Pages: (4): « First [ 1 ] 2 3 4 » Last »
[?] WM_MOUSEMOVE doesn't work
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
29 / Male / Flag
Joined: Jul 2007
O.P. [?] WM_MOUSEMOVE doesn't work
I seem to have a problem detecting mouse movement through WM_MOUSEMOVE. Is there a problem with my script or this message?

The point is: I want to check whether the mouse is over a control or not. I suppose that can be done with this message?

This post was edited on 04-18-2010 at 06:08 PM by SmokingCookie.
04-18-2010 07:24 AM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] WM_MOUSEMOVE doesn't work
Likely just a problem with your code. Post what you have and lets take a look.
04-18-2010 03:01 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
29 / Male / Flag
Joined: Jul 2007
O.P. RE: RE: [?] WM_MOUSEMOVE doesn't work
quote:
Originally posted by matty
Likely just a problem with your code.

You're right about that. I have solved it, but now there's another problem: I cannot press any button in the window. In fact, the window behaves as if it were disabled. It gets enabled when the window is deactivated (i.e. minimised) and activated again. Can it be that this has something to do with the SetCapture function?

Figured a lot out: SetCapture causes a window to detect mouse movement, but disables most of its other input stuff. However, not using SetCapture means you cannot detect mouse movement. The disabled-like behaviour is caused by SetCapture. Minimising and restoring position releases capture from the window and allows you to click buttons, etc.

But I still need to detect mouse movement :P

Post no. 700 :o)

This post was edited on 04-18-2010 at 06:08 PM by SmokingCookie.
04-18-2010 05:50 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [?] WM_MOUSEMOVE doesn't work
Don't use SetCapture for that, because it has some drawbacks and limitations as you have experienced.

SetCapture is meant to be used when you do an action with your mouse. Thus when you already have detected mouse movement over a control. Eg: you invoke it when you press (and hold) a mouse button inside a drawing control to draw lines. It is not meant to track mouse movement to see if you hoover over a control. For that you need _TrackMouseEvent.

http://www.mvps.org/user32/setcapture.html
http://msdn.microsoft.com/en-us/library/ms646266(v=VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms645602(...px#tracking_cursor

This post was edited on 04-19-2010 at 01:13 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
04-19-2010 01:08 AM
Profile PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
29 / Male / Flag
Joined: Jul 2007
O.P. RE: RE: [?] WM_MOUSEMOVE doesn't work
quote:
Originally posted by MSDN page about _TrackMouseEvent
dwFlags
    DWORD

    Specifies the services requested. This member can be a combination of the following values.

[DWORD values]



There is nothing like TME_ENTER that is fired when the mouse leaves a control. Or do I need to use TME_HOVER for that...?

Surprise, surprise: been messing around a little, and don't get it :s

Problem could be that I've worked from 5 to 8 after school ;)

This post was edited on 04-19-2010 at 07:43 PM by SmokingCookie.
04-19-2010 07:12 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [?] WM_MOUSEMOVE doesn't work
quote:
Originally posted by SmokingCookie
quote:
Originally posted by MSDN page about _TrackMouseEvent
dwFlags
    DWORD

    Specifies the services requested. This member can be a combination of the following values.

[DWORD values]



There is nothing like TME_ENTER that is fired when the mouse leaves a control. Or do I need to use TME_HOVER for that...?
To detect the mouse leaving the area you're tracking you need to specify TME_LEAVE.


quote:
Originally posted by SmokingCookie
Surprise, surprise: been messing around a little, and don't get it :s

Problem could be that I've worked from 5 to 8 after school ;)
get some sleep first, then read those links I gave ;) :p
.-= A 'frrrrrrrituurrr' for Wacky =-.
04-20-2010 02:05 AM
Profile PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
29 / Male / Flag
Joined: Jul 2007
O.P. RE: [?] WM_MOUSEMOVE doesn't work
Well, I'll never do ANY kind of programming/scripting after a full day of school and work, before going to bed. I've been busy with this all night long :S :P

But that's had positive consequences too. I've thought of the following theory: upon a call to _TrackMouseEvent, <some message>* will be posted to the window when the mouse moves over it. When the mouse leaves the window, some other message is posted.

* Can this be WM_MOUSEMOVE?
04-20-2010 02:10 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] WM_MOUSEMOVE doesn't work
We used WM_MOUSEMOVE in Screenshot Sender.

http://beta.screenshotsender.com/code/WindowHandl...ectArea_handler.js

Tried something like this?
Javascript code:
/* Create your window*/
pPlusWnd.RegisterMessageNotification(0x02A1 /* WM_MOUSEHOVER */)
var TRACKMOUSEEVENT = Interop.Allocate(16);
    TRACKMOUSEEVENT.WriteDWORD(0, 16);
    TRACKMOUSEEVENT.WriteDWORD(4, 0x1 /* TME_HOVER */);
    TRACKMOUSEEVENT.WriteDWORD(8, pPlusWnd.GetControlHandle('myControl'));
    TRACKMOUSEEVENT.WriteDWORD(12, 1);
 
function OnWindowSubClassEvent_MessageNotification(pPlusWnd, nMessage, wParam, lParam) {
    switch (nMessage) {
        case 0x02A1 /* WM_MOUSEHOVER */:
            Debug.Trace('i r on your control');
    }
}


This post was edited on 04-20-2010 at 02:58 PM by matty.
04-20-2010 02:52 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
29 / Male / Flag
Joined: Jul 2007
O.P. RE: [?] WM_MOUSEMOVE doesn't work
JScript code:
// Windows.js;
 
objPlusWnd.RegisterMessageNotification(WM_MOUSEHOVER,true);
var TRACKMOUSEEVENT = Interop.Allocate(16);
with(TRACKMOUSEEVENT) {
    writeDWORD(0,Size);
    writeDWORD(4,TME_HOVER);
    writeDWORD(8,objPlusWnd.GetControlHandle("BtnViewPage"));
    writeDWORD(12,1);
}
Interop.Call("Comctl32.dll","_TrackMouseEvent",TRACKMOUSEEVENT.DataPtr);
//Interop.Call("User32.dll","TrackMouseEvent",TRACKMOUSEEVENT.DataPtr);
TRACKMOUSEEVENT.Size = 0;
 
// WndSettings_Notif.js;
 
function OnWndSettings_NotifEvent_MessageNotification(PlusWnd,Message,wParam,lParam) {
    if(Hotkey_HandleEvent(PlusWnd,Message,wParam,lParam)) return -1;
    switch(Message) {
        case WM_MOUSEHOVER:
            Print("i r on ur control");
        return 0;
    }
}


But it ain't exactly working... :S

This post was edited on 04-20-2010 at 04:09 PM by SmokingCookie.
04-20-2010 04:08 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] WM_MOUSEMOVE doesn't work
What is the return value of the TrackMouseEvent call?

What about tracking WM_MOUSEMOVE and use GetCursorPos then use ChildWindowFromPoint comparing the hWnd of the control to that returned from the function?

This post was edited on 04-20-2010 at 04:37 PM by matty.
04-20-2010 04:25 PM
Profile E-Mail PM Find Quote Report
Pages: (4): « First [ 1 ] 2 3 4 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On