Hide Parent with Children - keep children hidden when showing parent again

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Hide Parent with Children - keep children hidden when showing parent again

    Dear all
    I have an active parent window with children. I'd like to hide the parent including its children.
    It appears that I need to hide individual child windows one by one, otherwise if I show the parent the unhidden children will be painted. Is it possible to hide the all of the windows at once such that once I show the parent again the children would still be hidden?
  • Hi,

    If you call WM_HideWindow(hParent), where hParent is the handle of the parent window, any child windows will become hidden as well.

    If you want the child windows kept hidden you have to manualy mark them as hidden by WM_HideWindow().

    With the functions WM_GetFirstChild() and WM_GetNextSibling() it is quite easy to iterate over all child windows of another window.

    Attached is an example where all child windows of a parent stay hidden after the parent gets shown again.

    Regards
    Sven
    Files