|
-
April 10th, 1999, 02:28 PM
#1
mouse over a pushbutton
I can use the CPoint object for knowing position in a dialog box. How can I tell if my mouse is positioned over a pushbutton. This would be similar to a tooltip however, I don't want to tell the user what the pushbutton does. I want to do something else if they are over the pushbutton. This will be done in OnMouseMove()
-
April 10th, 1999, 05:38 PM
#2
Re: mouse over a pushbutton
Hi,
You could do something like this:
CRect rectButton;
POINT ptCursorPos;
GetDlgItem(IDC_YOURBUTTON)->GetWindowRect(rectButton);
GetCursorPos(&ptCursorPos);
if (rectButton.PtInRect(ptCursorPos))
{
// Do Something
}
Daniel.
-
April 12th, 1999, 06:02 AM
#3
Re: mouse over a pushbutton
Do the check from within the MouseMove handler (which passes you the current mouse position), by getting the window rect of the button as Daniel suggests.
Dave
-
May 10th, 1999, 07:04 PM
#4
Re: mouse over a pushbutton
i m sure i downloaded some project from CODEGURU a week ago that was doing what you wanted...serach i the articles published and there is a downloadable one that does what you want..........
-
May 10th, 1999, 08:10 PM
#5
Re: mouse over a pushbutton
Subclass the pushbuttons and in its OnMouseMove go and do your stuff.....
Sally
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
|