How MFC configures controls that use Win7 styles instead of XP-style controls

Source: Internet
Author: User

Have you ever encountered MFC controls in the project style is Win7 style, run EXE program has become more ancient XP style? To modify a control's style, you first need to know why it affects the interface style.

The factor that affects the style of the interface control is that the character set used by the VS project affects the version of the interface control being used, thus affecting the interface effect.

The Unicode version automatically embeds Win7-style controls, and multibyte versions do not embed Win7 style controls, but rather old-style controls. Different character sets, by default, determine which version of the control to use.

Therefore, the simplest and most brutal way to modify an interface style is to modify the character set. Change multibyte to Unicode version.

However, some programs to change multibyte to Unicode version will be error, the error will be a very troublesome thing, so there is no way to do it?

Http://www.cjjjs.com/paper/xmkf/201661205622573.aspx the author of this article provided us with a solution.

The resolution steps are summarized as follows:

1. Click the VS Project's configuration Properties-"inventory" tool. To change the embedded manifest to No, run the program. Found in the program debug directory, the manifest configuration file is generated with the name: project name. exe.manifest.

2. Open the manifest configuration file and add the code between <dependency> and </dependency> in the following code location.

<?xml version="1.0"encoding="UTF-8"Standalone="Yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1"manifestversion="1.0"> <dependency> <dependentAssembly> <assemblyidentity type="Win32"Name="Microsoft.windows.common-controls"version="6.0.0.0"Processorarchitecture="x86"publickeytoken="6595B64144CCF1DF"Language="*"> </assemblyIdentity> </dependentAssembly> </dependency> <trustinfo xmlns="Urn:schemas-microsoft-com:asm.v3">

3. Re-compile and run.

Note: To change the embedded manifest to no, at this point the manifest configuration file is not embedded, so at run time, use to and EXE together, cannot be missing. This is not convenient. Therefore, you can put the build: project name. exe.manifest file into the source program directory, and put the profile name under the additional manifest file of the Inventory tool, and the embedded list to Yes. Can

How MFC configures controls that use Win7 styles instead of XP-style controls

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.