Win32 window Owner vs window Parent?

后端 未结 4 567
离开以前
离开以前 2020-12-08 06:10

In Win32 programming, what is the difference between a window\'s parent and a window\'s owner? I thought I had it figured out, then I came across this code:

         


        
4条回答
  •  眼角桃花
    2020-12-08 06:48

    Owner is the Window* responsible for a control or dialog (for example, responsible for creating/destroying the window).

    Parent is the next-senior window* to a control or dialog in the window chain, but isn't actually responsible for it (doesn't necessarily care about its lifecycle, etc). A window's parent can also be its owner.

    *Window vs window: Window is an actual window displayed on the screen; window is any object with a HWND (includes buttons, panels, etc).

提交回复
热议问题