Disable runtime themes not with the GUI project options

418 Views Asked by At

I'm looking to control runtime themes in a way that is friendly for version control tools. Be it programmatically, or by some configuration such as a text based manifest file (but not the DPROJ file through the GUI project options).

Is there any such way?

For clarification: The DPROJ is not committed to git because it is auto edited by Delphi for no apparent reason, and contains the command line parameters that anyone can modify daily.

1

There are 1 best solutions below

6
On

Thanks to @Remy's pointers, this is the code responsible for disabling themes using a custom manifest:

<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.Windows.Common-Controls"
      version="5.82.0.0"
      processorArchitecture="*"
      publicKeyToken="6595b64144ccf1df"
      language="*"
    />
  </dependentAssembly>
</dependency>

The critical parameter is which version of Common Controls is used:

  • version="5.82.0.0" will disable themes
  • version="6.0.0.0" and above will enable them