Delphi World - это проект, являющийся сборником статей и малодокументированных возможностей  по программированию в среде Delphi. Здесь вы найдёте работы по следующим категориям: delphi, delfi, borland, bds, дельфи, делфи, дэльфи, дэлфи, programming, example, программирование, исходные коды, code, исходники, source, sources, сорцы, сорсы, soft, programs, программы, and, how, delphiworld, базы данных, графика, игры, интернет, сети, компоненты, классы, мультимедиа, ос, железо, программа, интерфейс, рабочий стол, синтаксис, технологии, файловая система...
Использовать визуальный стиль XP для своего приложения

Оформил: DeeCo
Автор: http://www.swissdelphicenter.ch

{ 
  To benefit from the new look and feel (Visual Styles) for the Windows XP 
  environment, you must include a Manifest in your application. 
  (Either as resource or as file in the same directory where your application 
  resides) 

  The manifest is a XML document. It will allow Windows XP to decide which 
  version of the comctl32.dll to use when binding. 
  The XML document contains information about the application you are 
  writing as well as information concerning the version of the comctl32.dll to use. 

  The following instruction shows how to 
   * create the manifest document 
   * create the XP resource file 
   * include the file in your application 

  The steps 1-4 show how to create the files. 
  You can also download the manifest and resource file from the 
  Demo-download. 

}

 { 
  Damit eine Anwendung das neue Look-and-Feel (Visual Styles) von Windows XP 
  annimmt, muss eine Manifest Datei in der Applikation enthalten sein. 
  (Entweder als Ressource oder im gleichen Verzeichnis, wo sich die Applikation 
  befindet) 

  Das Manifest ist ein XML Dokument. 
  Wenn Windows dieses in einer EXE Datei vorfindet, wird automatisch die Version 6 
  von comctl32.dll geladen und die Controls erscheinen im XP Design. 

  Die Folgende Anleitung zeigt, wie man 
  * das manifest Dokument erstellt 
  * die Ressourcen Datei erstellt 
  * die Ressource in die Anwendung einbindet. 

  Das Manifest und die Ressourcen Datei konnen auch uber das "Demo-Download" heruntergeladen 
  werden. Dann konnen die Schritte 1-4 ausgelassen werden. 
}


 {1) 
  Copy this sample manifest and paste it into notepad or any text editor. 
  Kopiere das Beispiel Manifest und fuge es in einen Texteditor ein (z.B Notepad}


 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 <assemblyIdentity
     version="1.0.0.0"
     processorArchitecture="X86"
     name="CompanyName.ProductName.MyProgram"
     type="win32"
 />
 <description>Your Application Description</description>
 <dependency>
     <dependentAssembly>
         <assemblyIdentity
             type="win32"
             name="Microsoft.Windows.Common-Controls"
             version="6.0.0.0"
             processorArchitecture="X86"
             publicKeyToken="6595b64144ccf1df"
             language="*"
         />
     </dependentAssembly>
 </dependency>
 </assembly>

 {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 

  Andere im Manifest den "name" von assemblyIdentity und die 
  "description" mit eigenen Angaben. Speichere das Manifest als 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: 

  Erstelle eine weitere Datei, welche die Instruktionen zur Erstellung 
  der Ressourcen Datei enthalt. 
  Der Inhalt von WinXP.rc schaut so aus:}


   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: 

  Compilire nun mit Borland''s Resource Compiler (brcc32.exe), 
  die Datei WinXP.rc. Es wird dann eine WinXP.res Datei erstellt. 
  Gibt im MS-DOS Prompt, im Verzeichnis wo sich WinXP.rc befindet, nun folgendes ein:}

   brcc32 WinXP.rc


 (*5)
   Now include the resource in your application.
   Include the following compiler directive:
   immediately after {$R *.DFM}:

   Nun muss noch eine Compiler Directive dem Sourcecode hinzugefugt werden.
   Der Eintrag sollte unmittelbar nach der Form Directive {$R *.DFM} folgen,
   so wie hier:*)

   {$R WinXP.res}


 {6) 
  Compile your application and run it! 
  Compiliere die Anwendung und starte sie!}


 {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 

  Uberpruf nun, ob die Anwendung korrekt lauft. Einige Controls nehmen das neue XP Design
   nicht an (TGroupBox, TSpeedButton und andere)
   Bei der ListView mit vsReport Style muss dies beachtet werden:
   http://www.swissdelphicenter.ch/de/showcode.php?id=1117 
}
Проект Delphi World © Выпуск 2002 - 2024
Автор проекта: USU Software
Вы можете выкупить этот проект.