为XP和Vista / Windows 7创建Win32应用程序

时间:2011-09-14 14:05:10

标签: c++ windows winapi manifest

我使用纯win32 api(没有MFC或WPF)用C ++编写了一个应用程序。 我希望在Window XP和Windows Vista / Windows 7下运行相同的.exe。

我正在使用清单将Visual Styles添加到我的应用程序中的控件。但是,当我在XP机器上测试应用程序时,按钮不显示。仅编辑控件和菜单栏。

编辑:我想我忘记提及这一点,但该应用程序在WIndows 7 / Vista上运行正常。 编辑2:我正在使用MinGW编译器 我认为这是清单的问题,所以我删除它并重新编译我的程序。但按钮仍然没有出现。 我使用的清单如下:

<?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="*"
    name="BlackJack.Viraj"
    type="win32"
/>
<description>Your application description here.</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.2600.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>

问题出现在清单中还是其他问题?

4 个答案:

答案 0 :(得分:3)

请务必致电InitCommonControlsEx

答案 1 :(得分:1)

这是另一回事。假设它们是正常的标准按钮,无论清单看起来是什么,或者是否有清单,它们都应该显示出来。还有其他事情正在发生。

答案 2 :(得分:1)

答案 3 :(得分:0)

清单很好。因此问题必须在您的代码中。创建主题应用程序与非主题应用程序并不完全相同。

相关问题