Skip to main content
gamedev.net
🔒 Locked

Windows Mouse

Started by Rich Geldard Nov 25, 2004 at 10:42 PM 1 replies 550+ views
Original Post
Rich Geldard
Rich Geldard
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
hplus0603
hplus0603
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.
enum Bool { True, False, FileNotFound };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.