将VS6 MFC对话框应用程序的外观升级到VS2008

时间:2011-05-24 01:29:59

标签: visual-studio-2008 mfc

我正在将VS6 MFC对话框应用程序更新到VS2008。更新代码很简单,但对话框仍然具有老式的VS6外观。例如,组框具有方形边缘并且是深灰色。而不是VS2008应用程序组框的圆角和浅灰色。

如何强制我的应用程序使用VS2008 MFC对话框应用程序的更现代的外观?

1 个答案:

答案 0 :(得分:1)

新的MFC项目会将以下内容添加到stdafx.h:

// Define manifest directives to match platform
#ifdef _UNICODE
#if defined _M_IX86
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif

我还将以下内容添加到我的项目中,以明确地链接到UXTHEME.LIB,这些子类基本控件用于添加主题支持:

#ifdef _UXTHEME_H_
#pragma message( "Including uxtheme.lib for linking" )
#pragma comment(lib, "uxtheme.lib")
#endif