How to remove the system menu from an iconized application in Visual C++ (129224)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++ for Windows, 16-bit edition 1.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.5
- Microsoft Visual C++ for Windows, 16-bit edition 1.51
- Microsoft Visual C++ for Windows, 16-bit edition 1.52
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ 2005 Express Edition
This article was previously published under Q129224 Note Microsoft Visual C++ .NET (2002) supports both the managed code
model that is provided by the Microsoft .NET Framework and the unmanaged native
Microsoft Windows code model. The information in this article applies only to
unmanaged Visual C++ code.
Note Microsoft Visual C++ 2005 supports both the managed code
model that is provided by the .NET Framework and the unmanaged native
Windows code model. SUMMARY There are two ways to remove the system menu of an
application when a user clicks an iconized application:
- Override the main frame window's PreCreateWindow function
to remove the WS_SYSMENU from the window's style field. However, this method
removes the system menu altogether from the application.
- Override the main frame window's OnSize method, and change
the window style of the mainframe to either include or exclude the WS_SYSMENU
style bit depending on user action. Use this technique if the user wants to
remove the system menu when the application is iconized and add the system menu
back to the application when the application is restored.
Modification Type: | Major | Last Reviewed: | 12/9/2005 |
---|
Keywords: | kbcode kbhowto kbMenu KbUIDesign KB129224 kbAudDeveloper |
---|
|