Intercepting WM_WINDOWPOSCHANGED

Oct 22, 2020 at 4:58am
I'm intercepting WM_WINDOWPOSCHANGED for my MainWindow to do some stuff.
My problem is now, when I drag the window with the mouse, I'm getting 100s of WM_WINDOWPOSCHANGED messages from Windows per second and I would like to execute just the last of them, meaning after the user has released the mouse button and the window has reached it's desired position.
Is there a way to combine other windows messages like mousebutton actions with WM_WINDOWPOSCHANGED, to tell when the moving is finished without missing the last of these messages?
Oct 22, 2020 at 2:01pm
In WM_WINDOWPOSCHANGED, you could try just setting a bool variable like window_moved = true;

Then, in the mouse release event, check if window_moved is true, and if so do the corresponding action, and set window_moved back to false.
Oct 22, 2020 at 11:24pm
Hmm, yes, that's an idea, thanks.
Oct 30, 2020 at 9:44pm
You may have a look at the WM_EXITSIZEMOVE message.
Topic archived. No new replies allowed.