Jump to content
  • Advertisement

Archived

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

Floating

How do I know my mouse moved away from my dialog??

This topic is 5912 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

More exactly, I have an application with many dialogs, but there is one I want to notice that the mouse cursor left it. I cannot use the message ''onMouseMove'' on that dialog (it doesn''t tell me if the mouse left the dialog). Any elegant suggestion?

Share this post


Link to post
Share on other sites
Advertisement
Well, inside MouseMove, just get the size and position of the window... Like:

CRect rect;
GetWindowRect(&rect);

Then you just compare the mouse.x / mouse.y with rect... There might a function for that already, but it''s not hard...

I don''t know MFC that good so there might be easier ways...

/G

Share this post


Link to post
Share on other sites
But if the new position is outside of the dialog, there won''t be any ''onMouseMove'' message for that dialog, but for the newly focused (not really focused) window only!!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!