I\'m working with some windows API to create a little application. I already created the buttons, windows, alright.
But the problem is the components I created don\'t lo
For an application using windows controls, that is documented in this msdn article
Edit: To make a long story short, Windows needs to know for an application if it was intended to use the new style controls. Some older apps just aren't compatible with the new skinned looks of XP and later. Each exe should therefore declare with which version it is compatible in a manifest, an embedded xml file in the executable. The manifest is used for other things like declaring what you are or aren't compatible with (DLL versions, 120 dpi) as well as registration-free com.
In Visual Styles Reference: Functions of MSDN, I found an interesting functions, that is, SetWindowTheme(). It can be used to either to apply or remove visual style to/from a control/window, there are several steps need to be done to enable Visual Style in an application.
To use Windows Theme api, you'll need JwaUxTheme
unit of JEDI API Library.
However, applying theme from Windows Theme files (.theme
) to an application seems has to be done by turning off visual style from controls and write owner drawn controls based on information from .theme
files. MSDN has a documentation about .theme
file specification (see the first reference below).
Some good references:
Is Windows Presentation Foundation (WPF) Themes bad? There is a code example how to load it here.
If you use VCL, Theme Engine and Skin Engine has a complete support of themes for Windows XP.
If beauty application is your priority (without supports for Windows themes), I think, BusinessSkinForm and DynamicSkinForm is the best choice.
If you're using Delphi 2007 or later, Project > Options > Application > Use Windows Themes needs to be checked.
(This should be automatically checked for new applications).
If your executable name is YourAppName.exe then, create a manifest file named YourAppName.exe.manifest in the same directory where the executable application is.
YourAppName.exe.manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
name="YourAppName"
processorArchitecture="*"
version="1.0.0.0"
type="win32"/>
<description>MyApp</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
For embedding manifest file into executable use mt.exe commandline syntax:
mt.exe –manifest YourAppName.exe.manifest -outputresource:YourAppName.exe;1