Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Parent & owner

Parent & owner

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nbugalia
    wrote on last edited by
    #1

    Hi All, What is the difference between a parent and owner? I have three functions CWnd::GetParent (); CWnd::GetOwner (); CWnd::GetParentOwner (); Please help. Thanks, NB++

    J 1 Reply Last reply
    0
    • N nbugalia

      Hi All, What is the difference between a parent and owner? I have three functions CWnd::GetParent (); CWnd::GetOwner (); CWnd::GetParentOwner (); Please help. Thanks, NB++

      J Offline
      J Offline
      Jason Teagle
      wrote on last edited by
      #2

      In both cases, the parent or owner has been set as the parent of a control (e.g. SetParent(), or by specifying in the parent parameter of a Create() call). The difference is that if the control was created with the WS_CHILD style, then the outer window is a PARENT. If it was created without this style, it is only an OWNER. For a parent window, when the parent is minimized all child controls are hidden. For an owner only, 'owned' windows remain in place and can be minimized separately. Note that only 'windows' can be owned - 'controls' *must* have a parent and are therefore created with WS_CHILD. (GetParentOwner() will find the nearest window that is *either* a parent or an owner, but not a child - the others will keep walking up the chain until they find specifically one or the other.)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups