|
-
May 1st, 1999, 01:53 PM
#1
Getting mouse position if within a control
I have a dialog application. OnMouseMove is called anytime the mouse is within the dialog (client area). However, there is no mouse position when my cursor is over a pushbutton. I want something to happen when the cursor is over the pushbutton. The cursor position is present throughout the dialog box but it seems that OnMouseMove is not active while over a control. Any suggestions on how to know if the mouse is over a control? Thank you.
-
May 4th, 1999, 12:57 AM
#2
Re: Getting mouse position if within a control
Hi,
the mouse move message is always sent to the window (here dialog / control) the mouse is over, i.e. Your control gets the message and not the dialog. To follow the mouse, i can see two possibilities:
1) You can overwrite OnMouseMove for all of Your controls.
2) You can call SetCapture for Your dialog class. In this case all mouse messages are sent to Your dialog. So You can see, in which control the mouse is. But if You want in this case Your controls to accept clicks etc., You have to sent the messages there Yourself.
Possibly there are better possibilities, but if I don't know them myself...
HTH
Rudolf
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|