VB6 XP样式
1.启用资源编辑器
2.资源编辑器,新增自定义资源
注:XPThemes.manifest 文件内容如下:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>Windows Forms Common Control manifest</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
修改默认资源类型和ID
编译生产exe文件就完成了,程序就具有XP样式,当然win7,win10都可以的
#3.另外修改manifest 文件内容可以增加程序运行权限
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.1.0.0"
processorArchitecture="X86"
name="Manifest Creator"
type="win32"
/>
<description>Manifest Creation Application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<!-- Identify the application security requirements: Vista and above -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
不同取值对应不同的权限,注意这里不是自动提升程序的运行权限,而是要给系统给予程序什么权限才能正常运行,很多程序不需要管理员权限,设置asInvoke就可以了,如果需要管理员权限就要设置为requireAdministrator,在win10下会引起UAC权限请求提示。