Skip to content

Visual Styles

ITAgnesmeyer edited this page Apr 25, 2024 · 9 revisions

To enable the visual style, all you need to do is create an app.manifest file.

  • This file must then be selected in the project settings -> manifest. So that it is compiled into the application.

  • The Maifest file can also be embedded in the executable using MT.exe.

  • The best way is to create a resource file. Icons and accelerators can also be stored with this!

The manifest file looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
	<assemblyIdentity name="YourAppName" version="1.0.0.0" type="win32"></assemblyIdentity>
	<description>Diga Shell</description>
	<dependency>
		<dependentAssembly>
			<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"
                language="*"></assemblyIdentity>
		</dependentAssembly>
	</dependency>
	<dependency>
		<dependentAssembly>
			<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df"
                language="*"></assemblyIdentity>
		</dependentAssembly>
	</dependency>
	<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
		<application>
			<!-- Windows 10 and Windows 11 -->
			<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
			<!-- Windows 8.1 -->
			<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
			<!-- Windows 8 -->
			<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
			<!-- Windows 7 -->
			<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
			<!-- Windows Vista -->
			<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
		</application>
	</compatibility>

	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
		<security>
			<requestedPrivileges>
				<!-- For -->
				<!-- <requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel> -->
				<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
			</requestedPrivileges>
		</security>
	</trustInfo>
	<application xmlns="urn:schemas-microsoft-com:asm.v3">
		<windowsSettings>
			<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
			<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,PerMonitor</dpiAwareness>
		</windowsSettings>
	</application>
</assembly>

Use MT.EXE to update the Manifest.

  • Save the manifest-file in the publish directory with ending ".manifest". In this example "DIGAAppSetup.manifest" the Executable has the name "DIGAAppSetup.exe".
  • Open the Developer Console and change into the publish - folder.
  • Execute the command below.
mt -manifest DIGAAppSetup.manifest -outputresource:DIGAAppSetup.exe;#1

Application with Styling enabled.

If the application contains the Manifest it looks like this.

Application with Style

Application with Styling disabled.

If you do not use MT.exe or do not include app.manifest in your Project. The application looks like this.

Application with Style

Clone this wiki locally