Upgraded MFC application still looks old

给你一囗甜甜゛ 提交于 2019-11-28 11:37:17

You should at least add this line to your project, for example add to stdafx.h

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

See also Enabling Visual Styles

It gets more complicated for owner draw controls. See this reference: Using Visual Styles with Custom and Owner-Drawn Controls

For ListView and TreeView controls, you can call this function for a more modern look (although it doesn't make any difference in Windows 10)

SetWindowTheme(m_ListView.m_hWnd, L"Explorer", NULL);
SetWindowTheme(m_TreeView.m_hWnd, L"Explorer", NULL);

Also make sure your linker setting ALLOWISOLATION is set to 'Yes' otherwise the manifest is not even considered.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!