Jump to content
  • Advertisement


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


Getting coordinates of a Static control

This topic is 5322 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

I am writing a dialog app, that has OpenGL inside a static control on my dialog, My problem is I want to have input functions like:
  • OnLButtonDown
  • OnMouseMove
  • OnLButtonUp
But the problem is that for Mouse move the CPoint structure, holds points referring to the whole screen, I need the CPoint structure to reference x,y coordinates for the static control. Can I do this, I''d appreciate any help Thanks in advance, Keith

Share this post

Link to post
Share on other sites
Use GetWindowRect to get the coordinates of the rendering window relative to the whole screen, and use this info to figure out the coordinates on the client.

If the control you''re rendering to has a border or anything like that, you might need to do a bit of additional work to take these into account.

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!