Visual C++ 6.0中实现XP风格的程序界面。

    技术2025-04-01  43

    本文中所用到的方法从网上得到,时间长了找不到最终出处。就不写引用地址了:-)

    两种样式的对话框如图所示:

     

      

     

     

    对Visual C++ 6.0的程序实现XP样式有两种方法:

    第一种方法:

    它不仅对Visual C++ 6.0写的程序管用,对其它以前已经编写的在XP界面下显示为旧样式的程序同样有效。将下面文本保存为yourapp.exe.manifest,放于你应用程序同一个文件夹中再打开看看,是不是程序的界面跟原来看起来有所不同! 这里要注意的是yourapp为你的应用程序的名字。

    <?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="yourapp.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> 

    第二种方法:

    将上面的文件放于你的Visual C++ 6.0的项目文件夹中,然后选择[Insert]->[Resource... Ctrl+R]会显示"Insert Resource"对话框,选择[Custom]对话框插入一个类型为24的资源文件,然后将其ID改为1,再上面的文粘贴其中。再编译下看看,XP风格的窗口出现了!

     

    最新回复(0)