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

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

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,运行一下就知道了,不好用会报错滴。