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.
What Windows API messages are generated when a window is moved?
Members - Reputation: 398
Posted 22 September 2013 - 10:24 PM
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, 22 September 2013 - 10:25 PM.
Members - Reputation: 685
Posted 23 September 2013 - 10:23 AM
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" should be the name of your window procedure's second argument.
By doing this, you can see all the messages and their order.
Crossbones+ - Reputation: 5626
Posted 23 September 2013 - 10:59 AM
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).
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
Crossbones+ - Reputation: 2812
Posted 24 September 2013 - 01:37 AM
Also, never rely on a particular order unless it's documented. New messages may appear or the order may be changed in different Windows versions.