Windows SDK: Which are the differences between child and owned windows?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

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

  1. #1
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,023

    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; January 27th, 2010 at 12:56 AM.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center