The information in this article applies to:
SUMMARYTo change the default window attributes used by a framework application created in AppWizard, override the window's PreCreateWindow() virtual member function. PreCreateWindow() allows an application to access the creation process normally processed internally by the CDocTemplate class. The framework calls PreCreateWindow() just prior to creating the window. By modifying the CREATESTRUCT structure parameter to PreCreateWindow(), your application can change the attributes used to create the window. MORE INFORMATION
The CTRLBARS sample application, provided with the Microsoft Foundation
Class Library, demonstrates this technique to change window attributes.
Note that depending on what your application changes in PreCreateWindow(),
it may be necessary to call the base class implementation.
A little more work is required to change the window style of a child window
in a multiple document interface (MDI) application. By default, an MDI
application generated in AppWizard uses the default CMDIChildWnd class
defined in the Microsoft Foundation Class Library. To change the window
style of an MDI child window, your application must derive a new class from
CMDIChildWnd and replace all references to CMDIChildWnd in your project
with references to the new class. Most likely, the only reference to
CMDIChildWnd in the application is located in your application's
InitInstance() member function.
The default window style used in an MDI application is a combination of the WS_CHILD, WS_OVERLAPPEDWINDOW, and FWS_ADDTOTITLE styles. To change the window attributes of an MDI application's child windows, override the PreCreateWindow() function in your class derived from CMDIChildWnd. For example:
For more information about the PreCreateWindow() function, please refer to
the Microsoft Visual C++ "Class Library Reference, Volume 1," or to the
Visual C++ online help files and Visual C++ 4.0 Books Online.
Additional query words:
Keywords : kbMDI kbMFC KbUIDesign kbVC100 kbVC150 kbVC200 kbVC400 kbVC500 kbVC600 kbWndwClass kbGrpMFCATL kbArchitecture |
Last Reviewed: November 25, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |