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

    How to let CFrameWnd always and only on top of parent window?

    I have a parent window derived from CFrameWnd. When I switch among the tree items in the parent window, I will get a child window which is also derived from CFrameWnd. Current the child window is on top of every window, but this is not I want. It needs to be always but only on top of its parents and its content will be updated when I switch among the tree items in the parent window (thus can't be modal). The following is what I have for now:

    m_pChildFrame->Create(NULL, _T("Test"), WS_OVERLAPPEDWINDOW, CRect(0, 0, 200, 150), NULL, NULL, WS_EX_TOPMOST);

    I can't use CDialog to do similar thing. Thanks for your advice.

    Leo

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to let CFrameWnd always and only on top of parent window?

    Remove the WS_EX_TOPMOST flag, and set the first param to its parent hWnd.

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