Mega Code Archive

 
Categories / Delphi / Examples
 

How to use Visual Styles from XP in the own application

Title: How to use Visual Styles from XP in the own application {1) Copy this sample manifest and paste it into notepad or any text editor. processorArchitecture="X86" name="CompanyName.ProductName.MyProgram" type="win32" / Your Application Description name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" / {2) To customize to fit your application, replace "name" from assemblyIdentity and the "description" string with your own data. Then save the file as WinXP.manifest {3) Create another file which contains instructions to include the WinXP.manifest (XML) document. The contents of the WinXP.rc looks like this: 1 24 "WinXP.manifest" {4) Now we need to use Delphi's resource compiler (brcc32.exe) to compile the WinXP.rc file. Doing so will result in a WinXP.res From the command line, type the following: brcc32 WinXP.rc (*5) Now include the resource in your application. Include the following compiler directive: immediately after {$R *.DFM}: {$R WinXP.res} {6) Compile your application and run it! {7) Test it if it runs correctly. Note that some controls don't adapt the new XP design such as TGroupBox, TSpeedButton and some others. If you use the TListView component with the view style of vsReport, have a look at this tip: http://www.swissdelphicenter.ch/de/showcode.php?id=1117