Do you run into following error when trying to run a VS2013 .net application on Windows XP?
Error: Not a valid Win32 application!
This happens because the application is targeting .net framework 4.5 which is not supported on Windows XP. Target a lower framework to get your application working on XP.
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.
// Disables theme, I assume you have XP themes applied on your application
SetWindowTheme( GetSafeHwnd(), L"", L"" );
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.
EnableThemes( FALSE ); // No more theming
Another way to disable theming for an application is to right click on the exe goto properties->Compatibility->Disable visual Themes. See this screenshot…
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! 🙂
Note
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.