First look at Ms's interpretation of visual styles:
Windows XP and later operating systems support a feature called visual styles that enables the appearance of common contro LS to change based on the theme chosen by the user. Prior to Windows 8, your must specifically configure your application to use visual styles; Otherwise, the application ' s common controls is always rendered in the style associated with the Windows Classic theme, R Egardless of the currently selected theme. In Windows 8, visual styles can ' t is turned off, Windows Classic mode no longer exists, and high Contrast mode have been mo Dified to work with visual styles.
After XP, the system supports an interface called visual style that can change as the theme of the system changes. The program must explicitly enable this style, otherwise the program is a classic style interface, the program interface does not change with the system theme. Win8 also added a high-contrast mode interface, which is not discussed at this stage.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773187 (v=vs.85). aspx
You can obviously feel that visual styles are a lot more rounded and beautiful.
Ways to open Visual styles
To use Visual Styles, you need a sixth version or an updated ComCtl32.dll, ComCtl32.dll not be re-released, just preset in the system. The XP series is available in both the fifth and Sixth editions.
ComCtl32.dll, version sixth of ComCtl32.dll contains the user controls and the common controls. By default, the program uses the user controls defined in User32.dll and the common controls defined in version fifth ComCtl32.dll
ComCtl32.dll Version Introduction
ComCtl32.dll |
Version |
Distribution Platform |
4.0 |
Windows and Microsoft Windows NT 4.0 |
4.70 |
Internet Explorer 3.0 |
4.71 |
Microsoft Internet Explorer 4.0 |
4.72 |
Microsoft Internet Explorer 4.01 and Windows 98 |
5.80 |
Windows 98 Second Edition and Microsoft Internet Explorer 5 |
5.81 |
Windows Millennium Edition (Windows Me), Windows $, Microsoft Internet Explorer 5.01, Microsoft Internet Explorer 5.5, and Microsoft Internet Explorer 6 |
5.82 |
Windows XP, Windows Server 2003, Windows Vista, Windows Server, and Windows 7 |
6.0 |
Windows XP, Windows Server 2003 |
6.10 |
Windows Vista, Windows Server, and Windows 7 |
http://msdn.microsoft.com/en-us/library/windows/desktop/hh298349 (v=vs.85). aspx
@: Add a program listing Method 1 Create a new text XML-formatted manifest file "program name. Exe.manifest" in the project directory and add it to the resource with the file content
[HTML]View PlainCopy
- <? XML version= "1.0" encoding="UTF-8" standalone="yes"?>
- <Assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestversion="1.0">
- <assemblyidentity
- version="1.0.0.0"
- processorarchitecture="*"
- name="CompanyName.ProductName.YourApplication"
- type="Win32"
- />
- <description>your application description here. </Description>
- <dependency>
- <dependentassembly>
- <assemblyidentity
- type="Win32"
- name="Microsoft.windows.common-controls"
- version="6.0.0.0"
- processorarchitecture="*"
- publickeytoken="6595B64144CCF1DF"
- language="*"
- />
- </dependentassembly>
- </Dependency>
- </Assembly>
Mainfest: Description section assemblyidentity element's attribute set
Attribute |
Description |
Version |
Version of the manifest. The version must be in the form major.minor.revision.build (which is, N.N.N.N, where n <=65535). |
ProcessorArchitecture |
Processor for which your application is developed. |
Name |
Includes company name, product name and application name. |
Type |
Type of your application, such as Win32. |
Dependency segment assemblyidentity Element property set
Attribute |
Description |
Type |
Type of the dependency component, such as Win32. |
Name |
Name of the component. |
Version |
Version of the component. |
ProcessorArchitecture |
Processor that the component was designed for. Specifies the processor. Valid values are MSIL, x86, IA64, and AMD64. |
PublicKeyToken |
Key token used with this component. |
Language |
Language of the component. |
@: Method 2 for adding a program manifest
After vs2005, setting up visual styles does not require a program deployment manifest file, but simply sends a compilation instruction. Just add a few lines to the "stdafx.h".
[CPP]View PlainCopy
- #pragma COMMENT (linker, "\"/manifestdependency:type= ' Win32 ' \
- Name= 'microsoft.windows.common-controls ' version=' 6.0.0.0 ' \
- Processorarchitecture= '* ' publickeytoken=' 6595b64144ccf1df ' language=' * '"")
The MSND said it needed
[CPP]View PlainCopy
- <span style="White-space:pre" > </span>//If an application manifest running on Windows XP specifies that you want to
- //using ComCtl32.dll version 6 or later to enable visualization,
- //You need Initcommoncontrolsex (). Otherwise, the window cannot be created.
- Initcommoncontrolsex Initctrls;
- Initctrls.dwsize = sizeof (initctrls);
- //Set it to include all the applications that you want to use in the
- //Public control class.
- INITCTRLS.DWICC = icc_win95_classes;
- Initcommoncontrolsex (&initctrls);
But found not added also nothing, XP can be normal implementation, know how to say
@: Turn off visual Styles
1: You can call the Setwindowtheme function to close the visual styles of one or more controls
[CPP]View PlainCopy
- #include "Uxtheme.h"
- #pragma comment (lib, "UxTheme.lib")
[CPP]View PlainCopy
- Setwindowtheme (hwnd, L "", L"");
2: You can also call InitInstance before calling void Setthemeappproperties (DWORD dwFlags), do not set the STAP_ALLOW_NONCLIENT flag to close the entire program for all windows of the visual Styles
[CPP]View PlainCopy
- #include "Uxtheme.h"
- #pragma comment (lib, "UxTheme.lib")
[CPP]View PlainCopy
- DWORD dwFlags = (Stap_allow_controls | Stap_allow_webcontent);
- Setthemeappproperties (DwFlags);
http://blog.csdn.net/x356982611/article/details/18403869
Open the program's visual Styles