How to make you application look “Classic” without disabling Windows themes.

15 05 2008

The first thing that i do when I get a windows machine is to disable its themes(if any) and reset to classic style. May be I still love those golden days of Win 3.1 and Win98.

Like that some products also keep their classic style UI to avoid confusion to the field engineers due to look and feel changes. For that, the windows themes are disabled while deploying the field machines. But you can still make you application look classic without disabling the whole system themes.

You can use the api – SetWindowTheme() for that. Calling that function will null params will reset your window style to classic. See the code snippet below.

#include "uxtheme.h"
SetWindowTheme( GetSafeHwnd(), L"", L"" );

This is applicable only for windows version from XP onwards. And don’t forget to add UxTheme.lib to the project settings.

Targeted Audience – Beginners.