微软官网-MSDN-启用视觉样式https://learn.microsoft.com/zh-cn/windows/win32/controls/cookbook-overview?redirectedfrom=MSDN解决XP风格的极老式的主题,换成稍微时尚点的主题
XP风格:
win7风格:
方法1:
自己创建清单,然后添加到工程中,具体步骤参考上面这个MSDN链接
方法2:
StdAfx.h中添加代码
//#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_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' 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
然后配置项目工程属性,设置为生成清单,如果不设置生成清单的话,上面这段代码不能生效!!!