使用WindowsXP風格的對話框

使用Windows XP風格的對話框̣

1、插入資源,選擇"Custom",輸入“24”作爲資源的內型。

2、拷貝如下XML腳本到資源編輯器。

<?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>


你可以把腳本中“test.exe”和“Test Application”替換成你想要的名字,這對程序運行沒有任何影響。

3、把資源ID設置爲1

4、在WinMain()中加入InitCommonControls()語句(如果使用了MFC,請在CApplication::InitInstance()中加入),
不要忘記包含頭文件commctrl.h"
5、設置工程,在Link選項中,在Object/Library Modules編輯框中,填入"comctl32.lib"
6、至此你的程序已經具有漂亮的Windows XP對話框了。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章