Enable/Disable XP Visual Styles for your application

Via resource editor

For VC6 add this one line to your .rc file, open it in a text editor….


YourAppName.exe.manifest should be your application’s manifest file.

Or you can paste YourAppName.exe.manifest to your application folder and XP themes gets enabled.

From VC8 onwards manifest file should only be in your res folder, which will be picked up by the resoource compiler.

Disable themes

To disable XP themes programmatically for a particular window call SetWindowTheme with last two parameters set to L””. E.g.

[sourcecode language=’cpp’]// Disables theme, I assume you have XP themes applied on your application
SetWindowTheme( GetSafeHwnd(), L””, L”” );[/sourcecode]

To disable themes systemwide call EnableThemes with it’s only parameter set to FALSE, be careful! you won’t be able to enable it back unless you belong to the TCB(Trusted computing base) group, SE_TCB_PRIVILEGE.

[sourcecode language=’cpp’]EnableThemes( FALSE ); // No more theming[/sourcecode]

Another way to disable theming for an application is to right click on the exe goto properties->Compatibility->Disable visual Themes. See this screenshot…

Disable themes

You’ve got some other options too on this page which you should try out. Useful to do some “minor” OS simulation work.

Interesting stuff

Another interesting thing to do is, you’ve noticed that msdev/VS6 doesn’t use XP themes so just rename YourAppName.exe.manifest to msdev.exe.manifest and paste in the msdev.exe parent folder. Restart msdev and see the difference, do the same with visual sourcesafe or any other application that doesn’t support xp themes. Have fun! πŸ™‚


Just incase you don’t have the manifest file with you, search in MSDN with RT_MANIFEST as key. Copy and paste the XML text that you see on the page to the manifest that’s mentioned above.

3 thoughts on “Enable/Disable XP Visual Styles for your application

  1. Hi man! Cool stuff u have! Man I see you’re good in winAPI stuff… Can u help me with something?
    I’m trying to do a internet cafe software, and I need to AUTOHIDE TASKBAR or uncheck ON TOP OF OTHER APPS. I searched the whole www but I found nothing just hiding it. It is possible to help me with this one ? πŸ™ pls… tnx.. πŸ™

  2. XP and 2000 but I decided to use the StuckRects2 registry key to do the job. It works fine too.

Appreciate your comments...