Original posts: http://blog.csdn.net/zengweicdut/article/details/8837688
Under the Win7, under the operating system folder, you need the program to have administrator rights, the program has administrator rights to the method:
One, add administrator rights
1, add a folder in Resource view, name 24, change the resource name under folder to 1. Operation
(1)
(2)
(3)
2, add the following value in the resource 1, copy the following text, paste in it can:
<?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= "X86"
Name= "Mulitray.exe.manifest"
Type= "Win32"
/>
< TrustInfo xmlns= "Urn:schemas-microsoft-com:asm.v3" >
<security>
<requestedPrivileges>
<requestedexecutionlevel level= "Requireadministrator" uiaccess= "false"/>
</requestedPrivileges>
</security>
</trustinfo>
</assembly>
After pasting
Then, compiling, the software is a program with administrator privileges. program icon, there will be one more shield, there is no difference under XP.
Second, let the application use the current system style:
1, also add a 24,1 resource in ResourceView, and add the same as the administrator.
2. Set the value in 1 to:
<?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= "X86"
Name= "Microsoft.Windows.DundasDemo"
Type= "Win32"
/>
< Description>your app Description here</description>
< dependency>
<dependentAssembly>
<assemblyidentity
Type= "Win32"
Name= "Microsoft.windows.common-controls"
version= "6.0.0.0"
Processorarchitecture= "X86"
Publickeytoken= "6595B64144CCF1DF"
Language= "*"
/>
</dependentAssembly>
</dependency>
</assembly>
In this way, the program has the current system style, such as Win7 style, is added to the current style of an example, the button is already win7 style.
Note: The program can only have a 24,1 resources, and the resources under the name must be 24 and 1, it is also caused, the program has administrator rights, you can not have the system style, 2 can only choose one use, this is more depressed.
"Go" MFC Win7 Get Administrator privileges use the current system style using WIN7 style