Click to See Complete Forum and Search --> : Getting Mouse Position when over a Pushbutton


myoung
May 4th, 1999, 07:07 PM
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 in the dialog box. Any suggestions on how to know if the mouse is over a control? An example of waht I am referring to is tooltip. The tooltip get displayed when the cursor is over a control for a ceertain amount of time. I want something to happen immediately when a cursor is over a pushbutton. How do I detect this? Thank you.

Howard Birkett
May 4th, 1999, 07:30 PM
One way would be to create your own class derived from CButton, include it as a member variable of your dialog class and override OnMouseMove() in your derived button class.

Wizards will do all of this for you!

Howard