Sometimes, during the development of my applications, I wonder how they will look like when run on Windows XP with theming enabled. In my opinion, it is important that an application "fits" into its OS - be it Windows 9x/ME or NT/2k/XP. Consequently, my programs have to take visual styles into account to achieve this goal.
To make the life of the Delphi-developer a bit easier (even more :-), I have created a small hack to apply visual styles to the Delphi-IDE. This allows you to test your Forms with the new user interface.
This is how the Delphi-IDE (version 7.0) looks on a standard Windows XP system (click on the image to enlarge):
In a few minutes, your IDE will look like this:
Beginning with Windows XP, Microsoft decided to create a new branch of the Windows Common Controls. To maintain compatibility with existing applications, every program that doesn't include a so-called "Manifest" automatically uses version 5.0.x of these controls. This "Manifest" can either be a directly-linked resource in the executable or - at the programmers' option - a simple XML-file with the same basename in the working directory of the application.
When loading an executable, windows tries to find the corresponding "Manifest"-file before initializing the Windows Common Controls. If it is found, the application can make use of the new theming feature.
Now the "trick": Using the file-based approach, it is possible to load the new Controls for _every_ application. Just copy the "Manifest"-file into the program's directory and rename it to the same basename.
Be careful: Sometimes forcing to theme an application can lead to unexpected results (i.e. protection faults, random crashes, runtime exceptions...). This is especially the case with Delphi 6.0, since it's support for the "ListView"-control is somewhat broken with version 6.0 of the Common Controls. Delphi 5.0 and 7.0 should be safe, howeber.
To learn more about "Manifest"-files and so-called "shared side-by-side assemblies", you may want to visit the following sites:
I hope the information provided in this article helps you to improve your application's look & feel, so that they well integrate with the new Microsoft Windows "Luna" User Interface. Besides, Delphi just looks better when everything else is also themed.
Don't hesitate - email me with your thoughts: