Archived

This topic is now archived and is closed to further replies.

edwinnie

setting the correct trap for the mouse...

Recommended Posts

okie, i am trying to include mouse support to a specific menu. lets say, in a rectangle, of sample coordinates x1,y1 & x2,y2. most of the time, the mouse always "detects outside" that range. anyone has a good solution?

Share this post


Link to post
Share on other sites
Not sure if this is what you mean or not, but you could use PtInRect to test it. ie:

You would have a POINT called ptMouse and a RECT called rcBtn.
To test if the mouse is over the button you would use:

if(PtInRect(&rcBtn,ptMouse)!=0)
{
//the mouse is over the button
}

Share this post


Link to post
Share on other sites