-
January 25th, 2010, 08:54 AM
#1
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
- can be displayed only in the parent client area;
- are moved when the parent is moved (the position relative to the parent client area desn't change);
- are disabled when the parent is disabled;
- CreateWindow(Ex), MoveWindow, SetWindowPos, etc take coordinates relative to parent client area;
- have WS_CHILD style set;
- usually, child windows are controls like buttons, edit boxes, etc or MDI child frames.
Owned windows
- can be displayed anywhere in the screen;
- are not moved when the owner is moved;
- are not disabled when the owner is disabled;
- CreateWindow(Ex), MoveWindow, SetWindowPos, etc take screen coordinates;
- have not WS_CHILD style;
- usually, owned windows are popup or overlapped windows.
See also
Last edited by ovidiucucu; October 5th, 2022 at 05:27 AM.
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|