| RTL referenceGlossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link To |
| Windows XP Manifest in Delphi | |||||||||||||||||||
| Find out how you can include the manifest into a Delphi project to allow your application to share the same look and feel of Windows XP. | |||||||||||||||||||
Article submitted by: Michael A. Allen Why? By default, all programs written under Windows XP will default to version 5.8, maintaining the same look and feel of the legacy windows applications. In order to enter 6.0 of the control, you must include in your application, a Manifest that the OS will read in order for the theme manager to take control of drawing the new look and feel for the Windows XP environment. What? How? To create the .RES file that we need, we need to first create a .RC file that assigns our manifest XML document to the appropriate group number and line item number. In the ZIP file included with this document, you'll notice two files: 1) WindowsXP.RC and The WindowsXP.RC contains our instructions to include the WindowsXP.Manifest (XML) document as line item 1 bound to group 24. The contents of the WindowsXP.RC looks like this: 1 24 "WindowsXP.Manifest" The manifest itself, is an XML document that contains information about the application you are writing as well as information concerning the version of the comctl32.dll to use. It's contents will require a certain amount of customization to fit your application, but will look similar to this:
Now that we have these two files in place, we need to use Delphi's resource compiler to compile the .RC file. Doing so will result in a WindowsXP.RES file that we can include in our applications. From the command line, type following (keep in mind, you should include the Delphi's BIN directory in our path for this to work) C:\Project1> brcc32 WindowsXP.RC After you have compiled the WindowsXP.RC file, you see a WindowsXP.RES file in the same directory. The final step to making your application Windows XP compatible is to include this resource in your application. The easiest way to do this, is to include either in your project file (.DPR) or your primary form, the following compiler directive: {$R WindowsXP.RES} You should probably place this immediately after the {$R *.DFM} compiler directive that is already in your application, directly after the implementation clause. Once you have included your WindowsXP.RES file into your application, compile your application and run it. The Windows theme manager, to adapt the same look and feel of other applications written for Windows XP, now instantly converts your windows controls. Warnings If you need some more help on this subject, please post your comments to the Delphi Programming Forum. In any case, download the demo project - and try it for yourself. |
|||||||||||||||||||
All graphics (if any) in this feature created by Zarko Gajic.
| More Delphi |
| · Learn another routine every day - RTL Quick Reference. · Download free source code applications and components. · Talk about Delphi Programming, real time. · Link to the Delphi Programming site from your Web pages. · Tutorials, articles, tech. tips by date: 2001|2000|1999|1998 or by TOPIC. |
| · NEXT ARTICLE: Perfect Gift: Delphi 6 and Kylix (almost) for FREE. For a limited time only, Borland Cross-Platform RAD is available to Visual Basic developers at the special price! Buy Delphi 6 professional at the half price and get Kylix Desktop and Delux Standard for FREE. |
| Stay informed with all new and interesting things about Delphi (for free). |
|
|
| Got some code to share? Got a question? Need some help? |
