CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Windows SDK: Which are the differences between child and owned windows?

    Q: Which are the differences between child and owned windows?

    A: Both child and owned windows depend on another window (named parent or owner, respectively).
    This dependence implies common behaviors like staying in front of parent/owner or being destroyed when the parent/owner is destroyed.
    Because of that, many people make a confusion naming "child" owned windows and "parent" owner windows.
    However, there are significant differences between the two kind of windows, as follows:

    Child windows
    1. can be displayed only in the parent client area;
    2. are moved when the parent is moved (the position relative to the parent client area desn't change);
    3. are disabled when the parent is disabled;
    4. CreateWindow(Ex), MoveWindow, SetWindowPos, etc take coordinates relative to parent client area;
    5. have WS_CHILD style set;
    6. usually, child windows are controls like buttons, edit boxes, etc or MDI child frames.


    Owned windows
    1. can be displayed anywhere in the screen;
    2. are not moved when the owner is moved;
    3. are not disabled when the owner is disabled;
    4. CreateWindow(Ex), MoveWindow, SetWindowPos, etc take screen coordinates;
    5. have not WS_CHILD style;
    6. usually, owned windows are popup or overlapped windows.


    See also
    Last edited by ovidiucucu; October 5th, 2022 at 05:27 AM.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

Tags for this Thread

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