Jump to content
  • Advertisement
Sign in to follow this  
jdub

What Windows API messages are generated when a window is moved?

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

What message(s) are sent to tell me that my window has been moved?  I know that WM_PAINT occurs but as I understand, that doesn't necessarily mean that the coordinates of the window have changed.  Also, I know about WM_SIZE but from what I understand, that only occurs when the window has been resized, minimized or maximized.

Share this post


Link to post
Share on other sites
Advertisement

In no particular order:

 

WM_ENTERSIZEMOVE

WM_EXITSIZEMOVE

WM_MOVE

WM_WINDOWPOSCHANGING

WM_WINDOWPOSCHANGED

Edited by mark ds

Share this post


Link to post
Share on other sites
Guest Hiwas
You missed the NC messages for mouse over the non-client area. Not sure they would matter to most folks though.

Share this post


Link to post
Share on other sites

You missed the NC messages for mouse over the non-client area. Not sure they would matter to most folks though.

 

I figured that if someone wasn't aware of WM_MOVE then perhaps the NC's would be overkill!

Edited by mark ds

Share this post


Link to post
Share on other sites

If you're using Visual Studio, you can set up a tracepoint at the beginning of your window procedure.  In the "Print a message" box, put the following:

 

{message,wm}

 

"message" should be the name of your window procedure's second argument.

 

By doing this, you can see all the messages and their order.

Share this post


Link to post
Share on other sites

It depends on why you need this information.  If you're just e.g. using the post-move coords for constraining the mouse position, then WM_MOVE on it's own will be sufficient (but beware that you may not get any of these messages if in a fullscreen display mode).

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!