Simple Doubt on Mouse Event Capture 
Author Message
 Simple Doubt on Mouse Event Capture

Look at WM_MOUSELEAVE. You will have to use TrackMouseEvent for this. Older versions of Windows 95 did not support it. It is supported on Win98, NT and newer versions of Win95. I saw a post about getting latest ComCtl.dll if you have older version of Win95.

You can also do it using SetCapture().

--
Ajay Kalra


    Hi
    I have developed a ActiveX control and in that a feature is like if the user moves the mouse around the control it changes its colour . I am able to do this on MOUSE MOVE event.
    but when the mouse moves away from the control I need to rest the colour to default..how to do it?
    because I never know when the mouse moved out?
    Is there  a way that I get the the mouse move event no matter where the mouse is moving?
    help me!!
    thanks
    vijju



Fri, 10 Aug 2001 03:00:00 GMT  
 Simple Doubt on Mouse Event Capture

Quote:

>Hi
>I have developed a ActiveX control and in that a feature is like if the user moves the mouse around the control it changes its colour . I am able to do this on MOUSE MOVE event.
>but when the mouse moves away from the control I need to rest the colour to default..how to do it?
>because I never know when the mouse moved out?
>Is there  a way that I get the the mouse move event no matter where the mouse is moving?

Take a look at SetCapture().  It won't necessarily let you track the mouse no
matter where it is, but it will certainly let you know that the mouse has left
your window (it will always send one mousemove event outside the bounds of
your window before it goes quiet).

Before you rush in and do that, read the docs carefully on SetCapture(),
ReleaseCapture(), and WM_CAPTURECHANGED  (*especially* WM_CAPTURECHANGED).

Scott Amspoker          |

http://www.rt66.com/sda |



Fri, 10 Aug 2001 03:00:00 GMT  
 Simple Doubt on Mouse Event Capture
Try setting you the default color when you receive a WM_NCHITTEST



Hi
I have developed a ActiveX control and in that a feature is like if the
user moves the mouse around the control it changes its colour . I am able
to do this on MOUSE MOVE event.
but when the mouse moves away from the control I need to rest the colour to
default..how to do it?
because I never know when the mouse moved out?
Is there  a way that I get the the mouse move event no matter where the
mouse is moving?
help me!!
thanks
vijju

----------



Fri, 10 Aug 2001 03:00:00 GMT  
 Simple Doubt on Mouse Event Capture

WM_MOUSELEAVE was discussed in Oct 98 issue of MSJ. You can download the source from www.microsoft.com/msj. Example was called Flyby and it is in C++ Q and A section by Paul Dilascia.

--
Ajay Kalra


    Look at WM_MOUSELEAVE. You will have to use TrackMouseEvent for this. Older versions of Windows 95 did not support it. It is supported on Win98, NT and newer versions of Win95. I saw a post about getting latest ComCtl.dll if you have older version of Win95.

    You can also do it using SetCapture().

    --
    Ajay Kalra


        Hi
        I have developed a ActiveX control and in that a feature is like if the user moves the mouse around the control it changes its colour . I am able to do this on MOUSE MOVE event.
        but when the mouse moves away from the control I need to rest the colour to default..how to do it?
        because I never know when the mouse moved out?
        Is there  a way that I get the the mouse move event no matter where the mouse is moving?
        help me!!
        thanks
        vijju



Fri, 10 Aug 2001 03:00:00 GMT  
 Simple Doubt on Mouse Event Capture

Quote:
>Try setting you the default color when you receive a WM_NCHITTEST

That's not reliable.  Not only can the user easily move the mouse fast enough
to miss the NC regions, but it will completely fail if the mouse moves to an
overlapping window.  SetCapture() is probably the cleanest reliable approach.
Others have also mentioned the WM_MOUSELEAVE message which is not available on
all versions of Windows.

Scott Amspoker          |

http://www.rt66.com/sda |



Sat, 11 Aug 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ToolBarButton capturing Mouse events?

2. Capturing mouse events on a TreeNode

3. Capturing Mouse & Keyboard Events Anywhere in Application

4. Capture mouse events

5. Capturing the Mouse Up Event

6. New to C++ : Capturing mouse/keyboard events?

7. Capturing Mouse & Keyboard Events Anywhere in Application

8. Capturing mouse events

9. Why Mouse Mouse event with every Click event

10. doubts in VC++,SCREEN CAPTURING,DRIVE MAPPING

11. mouse down event interfearnig with double click event

12. Doubt on Mouse move

 

 
Powered by phpBB® Forum Software