question

RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 asked Viorel-1 edited

Using an application manifest to disable window theming

According to application-manifests the disableTheming element is available. I added the necessary xml to my application manifest for a Win32 desktop application but it seems that disableTheming is ignored by the system.
The xml that was added to the application manifest was as follows

 <?xml version="1.0" encoding="utf-8"?>
 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
     <asmv3:application>
         <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
             <disableTheming>true</disableTheming>
         </asmv3:windowsSettings>
     </asmv3:application>
 </assembly>

The documentation at manifest-file-schema indicates that disableTheming belongs to the http://schemas.microsoft.com/SMI/2011/WindowsSettings namespace but this is erroneous. An application using this namespace in the manifest fails to start with an SxS error that disableTheming is not registered. Inspection of the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SMI\WinSxS Settings\x86_microsoft-windows-settings_31bf3856ad364e35_none_025c648fcaefab55 indicates that the 2005 namespace is the correct one.

Regardless of the manifest contents dialog windows and their controls continue to be themed. Has anyone gotten disableTheming to work?


windows-apic++
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Maybe calling SetThemeAppProperties(0) before creating windows has almost the same effect.


0 Votes 0 ·

My experiment with the manifest is related to the problems caused by SetThemeAppProperties that are discussed in cfiledialog-has-empty-view-dropdown.html. The questioner in that thread wanted to disable themed windows while still using the V6 common controls. Alternatives to SetThemeAppProperties that came to mind were 1) call SetWindowTheme for every window, including all controls (not very practical) and 2) disableTheming using a manifest.


0 Votes 0 ·

I think that if an application uses SetThemeAppProperties to disable themes, then it was not successfully ported.

0 Votes 0 ·
Show more comments

0 Answers