was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

40 Visitors Online


 
...Visual Styles von XP in der eigenen Applikation verwenden?
Autor: Thomas Stutz
[ Tip ausdrucken ]  


Tip Bewertung (41):  
     


{
  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 können auch über das "Demo-Download" heruntergeladen
  werden. Dann können 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 füge 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

  Ändere 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 enthält.
  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 hinzugefügt 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

  Überprüf nun, ob die Anwendung korrekt läuft. 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
}

 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners