vs2008 vs2010非unicode下控件有操作系统样式,控件样式跟随操作系统

来源:互联网 发布:励志类书籍推荐知乎 编辑:程序博客网 时间:2024/05/19 16:03

unicode 有点麻烦,对于懒人来说,这不是个好办法,去掉unicode又发现控件奇丑无比:-(

打开vs2008的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_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

我们把他单独添加到最后就可以了:

#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")

至于是x86还是amd64,运行一下就知道了,不好用会报错滴。