The information in this article applies to:
SUMMARYThe window object returned by CWnd::GetParent in a modal dialog box is the top-level window that owns the dialog box, usually the main window. It is not necessarily the window object that has been passed to the constructor or Create() of the CDialog object. If you need to access the parent window that was passed in the constructor of the dialog-box object, then you need to save a copy of this pointer in the dialog-box object. MORE INFORMATION
When Windows creates a new popup window or a top-level window, such as a
dialog-box window, it is passed the handle of the parent window for the
dialog box. If the specified parent window is not a top-level window, then
Windows repeatedly calls GetParent until it finds the handle of a top-level
window that contains the specified parent window. Windows then sets this
top-level window to be the parent of the new popup or top-level window. So,
after the new window is created, if you call GetParent in that window, you
will get the pointer to the top-level window object that contains the
original parent window that you passed in the constructor or Create() call. Additional query words: 7.00 1.00 1.50 2.00 2.10 2.50 2.51 2.52 3.00 3.10 kbinf 4.00
Keywords : kbMFC KbUIDesign kbVC |
Last Reviewed: July 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |