6
votes

Does anyone know how to detect if a Win32(c++) window has stopped moving?

WM_MOVE detects when the window is moving, but how does one detect when it has stopped moving?

1
You don't really know it's moving, all you know is that is has moved. The difference is subtle. - Mark Ransom
So, WM_MOVE triggers when the window is not moving? Edit: You are right. - James Diaz
Yes, Sent after a window has been moved. WM_MOVE message (Windows). - Zilog

1 Answers

9
votes

The windows message you wish to handle is WM_EXITSIZEMOVE.

WM_EXITSIZEMOVE message (Windows) @ MSDN

Depending on what you wish to accomplish, there's also the possibility that you might be better served by reacting to WM_NCLBUTTONUP, which is sent when the mouse button is released in the non-client areas of a window, such as the title bar of any window with a caption, border chrome, etc.

WM_NCLBUTTONUP message (Windows) @ MSDN