Microsoft KB Archive/101184

= INFO: Retrieving the CMDIChildWnd Parent Window =

Article ID: 101184

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 1.0 Professional Edition

 Microsoft Visual C++ 1.5 Professional Edition

 Microsoft Visual C++ 1.51

 Microsoft Visual C++ 1.52 Professional Edition</li></ul>

 Microsoft Visual C++ 1.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.1</li></ul>

 Microsoft Visual C++ 4.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q101184

<div class="summary_section">

SUMMARY
When creating a CMDIChildWnd, the parent of the multiple document interface (MDI) window is a "MDICLIENT" control. The handle to the parent frame window can be retrieved in the following way: hwnd =::GetParent(lpcreatestruct.hwndParent); Alternatively, use the following CMDIFrameWnd* pFrame = (CMDIFrameWnd*)GetParentFrame; to acquire a pointer to the parent MDI frame window object.

NOTE: GetParentFrame is declared to return a pointer to a CFrameWnd object, and therefore it is necessary to typecast the result to a CMDIFrameWnd object.

Additional query words: kbinf 1.00 1.5 1.51 1.52 2.00 2.10 2.5 2.51 2.52 3.00 3.10 4.00

Keywords: kbinfo kbuidesign kbdocview kbmdi KB101184

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.