Upgraded MFC app still looks old

I have an MFC application written with VC6. I updated it to VS2015 and it builds and runs. The application is the main exe with many DLLs in which there are dialogs.

However, the application still looks like it was built using VC6. None of the GUI components has the appearance of Windows 7, they all still look old.

How can I make an existing application more modern?

+4
source share
2 answers

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

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

Or add the following to your manifest file:

<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>

See also Enabling visual styles.

. . :

ListView TreeView ( Windows 10 )

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

* #pragma comment Visual Studio.

+10

, ALLOWISOLATION "", .

0

Source: https://habr.com/ru/post/1608599/


All Articles