Jump to content
  • Advertisement
Sign in to follow this  
Rich Geldard

Windows Mouse

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

Hi, i'm currently making an application with 4 viewports. i'm using the basic windows WM_MOUSEMOVE to get the position of the cursor and updating values stored elsewhere so when the WM_LBUTTONDOWN is recieved i know where the click was. I can then test if this position is > height/2 or width/2 to see which viewport was clicked on. This has been working fine untill i realised that if the window is moved, the click no longer relates to the correct place in the clients area. Therefore the wrong viewports are being selected. Does anyone know how i might get around it so it workes when after its moved? or know where i'm going wrong? Sorry this is probably something really simple that i've missed but please help... Thanks Rich

Share this post


Link to post
Share on other sites
Advertisement
Look into ScreenToClient() and friends.

In general, when you have a Windows programming question, it's always answered on MSDN. Search through the Platform SDK documentation, the tutorials, the technical articles, and the overviews there, and you'll find whatever it is you need.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!