为什么更改ComCtrl的版本时不能更改CStatusBarCtrl的bk颜色​​?

时间:2018-07-26 07:52:31

标签: mfc

我想更改旧的MFC App的外观,因为我尝试更改Microsoft.Windows.Common-Controls的版本 通过将此行添加到项目中的文件之一

#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

但是现在CStatusBarCtrl :: SetBkColor对我不起作用 我该如何解决

谢谢

1 个答案:

答案 0 :(得分:0)

SB_SETBKCOLOR 仅在关闭视觉样式时有效。因此,您需要禁用视觉主题以使其起作用。

我建议子类化状态栏并处理WM_PAINT以便自定义外观。