CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    2

    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?


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: reparenting windows

    Have you tried hiding the child window first, and then display it after it's been moved?

    Regards,

    Paul McKenzie



  3. #3
    Join Date
    May 1999
    Posts
    2

    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


  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured