-
reparenting windows
I am reparenting window, while moving it (modal move/size loop was started by SC_MOVE). Windows retains client coordinates of child even with new parent window. To prevent this jumping, I move, after changing its parent, window to same position (in screen coordinates) it had before. This works well, but child window is still briefly displayed at its right-after-reparenting position. How can I eliminate this?
-
Re: reparenting windows
Have you tried hiding the child window first, and then display it after it's been moved?
Regards,
Paul McKenzie
-
Re: reparenting windows
I tried that - doesn't work.
ShowWindow(SW_HIDE);
SetParent(.., ..);
MoveWindow(...);
ShowWindow(SW_SHOW);
I am thinking of handling WM_POSITIONCHANGING and disabling any moves while reparenting.
Thanks,
YYY
-
Re: reparenting windows
Have you tried the DeferPos() functions? They allow you to move and size a window but instead of moving or sizing the window, it caches the window movements in a structure. When it's time to display the results of all of window movements, the EndDeferWindowPos() function displays the final results. Check out BeginDeferWindowPos(), DeferWindowPos(), and EndDeferWindowPos().
These functions aren't wrapped by MFC, so they are not talked about that much.
Regards,
Paul McKenzie