Click to See Complete Forum and Search --> : reparenting windows
YYY
May 7th, 1999, 09:08 AM
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?
Paul McKenzie
May 7th, 1999, 01:38 PM
Have you tried hiding the child window first, and then display it after it's been moved?
Regards,
Paul McKenzie
YYY
May 7th, 1999, 01:47 PM
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
Paul McKenzie
May 7th, 1999, 02:40 PM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.