Einzelnen Beitrag anzeigen

Benutzerbild von Corpsman
Corpsman

Registriert seit: 8. Nov 2005
Ort: nähe Stuttgart
981 Beiträge
 
Delphi XE2 Professional
 
#2

Re: Icon des Delphi Projectes einstellen über Quellcode

  Alt 22. Sep 2006, 07:24
Ho,

Zum Glück habe ich noch andere Quellen. Das Problem ist nun gelöst Hier also für alle die Lösung :

Die Icon.rc mus geändert werden in

MAINICON ICON DISCARDABLE "icon.ico" und die project1.dpr ändert sich dann zu :
Delphi-Quellcode:
Program Project1;

Uses

  Forms,
  shellapi, // benötigt fürs laden des Icons
  graphics, // benötigt fürs laden des Icons
  Unit1 In 'Unit1.pas{Form1};

{$R 'Icon.res' 'Icon.rc'} // Einbinden der Icon Ressource in "Icon.rc" steht der Index 0

//{$R *.RES} // Das einbinden dieser Ressource entfällt nun wer weitere Ressourcen einbinden will mus dies nun in Icon.rc machen

Var // benötigt fürs laden des Icons
  Icon: TIcon; // benötigt fürs laden des Icons
Begin
  Icon := TIcon.Create; // benötigt fürs laden des Icons
  Try // benötigt fürs laden des Icons
    Icon.Handle := ExtractIcon(hinstance, pchar(paramstr(0)), 0); // benötigt fürs laden des Icons
    Application.Icon.Assign(Icon); // benötigt fürs laden des Icons
  Finally // benötigt fürs laden des Icons
    Icon.Free; // benötigt fürs laden des Icons
  End; // benötigt fürs laden des Icons
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
End.
Uwe
My Sitewww.Corpsman.de

My marble madness clone Balanced ( ca. 70,0 mb ) aktuell ver 2.01
  Mit Zitat antworten Zitat