Woody20
Woody20

Reputation: 867

Visual style of C++/MFC dialogs in Windows 7?

How can I control the visual style of C++/MFC dialogs in Windows 7? enter image description here

The "Before" picture shows what I want, and this was the case until about a week ago. Now, my dialog appears as in the "After" picture, which is not what I want.

How can I control which style is used? I cannot find any manifest file, nor any option in the VS compiler or linker options, which controls this. My project is being built using MFC as a static library, and is not Unicode. It is being run under Windows 7.

64-bit Windows 7; Visual Studio Community 15.6.4; Windows SDK 10.0.16299.0

Upvotes: 1

Views: 2240

Answers (2)

Tom Tom
Tom Tom

Reputation: 1209

Without programming. You can get the the style back as before, by turning on the Reduced color mode in Compatibility Settings. (Righ click - Properties - Compatibility), Check if this is suitable for you.

enter image description here

Upvotes: 0

Andrew Truckle
Andrew Truckle

Reputation: 19107

Under normal circumstances you have this in your source code somewhere. For me the system puts it in the stdafx.h File at the bottom:

If you have code like this then it will have visual styles:

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

If you want to switch it off, then the link in the comments to your question tells you how:

You can turn off visual styles for a control or for all controls in a window by calling the SetWindowTheme function as follows:

SetWindowTheme(hwnd, L" ", L" ");

Upvotes: 2

Related Questions