1、實現原理:
微軟為Windows XP提供了Themes服務。Themes可以讓程序具有「XP風格」,看起來更美觀,因為微軟更新了Comctl32.dll(ver 6.0)這個「XP風格」的控制項。微軟還為了保留傳統的Windows界面風格,特地留下了Comctl32.dll v5.8。VC6的推出時間早於WinXP,因此VC6的程序默認是不使用「xp風格」的。
程序使用xp風格主要是內置了manifest這東東。因此只要讓VC6的程序中包含即可。包含可以外置,也可以內置為資源。
2、實現方法:
1>打開你的VC6 工程,找到資源試圖(ResourceView),然後在視圖中的樹的根結點上點滑鼠右鍵,選擇菜單「插入(Insert)」。
2>在彈出的「插入資源(Insert Resource)」對話框中選擇「自定義Custom」,在新對話框(「New Custom Resource」)輸入框中輸入 24。 因為manifest的類型是24, 點擊「OK」按鈕。
3>在資源視圖的樹上面選擇24下方的條目「DDR_DEFAULT1」上點右鍵,選擇「Properties」,將ID:修改為1.
4>雙擊剛才修改的「1」條目,然後在右方的編輯器窗口中輸入下面的代碼:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="test.exe"/>
<description>Test Application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>
5>保存工程,重新編譯