Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi dll Formular Icon zuweisen (https://www.delphipraxis.net/73909-dll-formular-icon-zuweisen.html)

Baeuerle 25. Jul 2006 15:57


dll Formular Icon zuweisen
 
Hallo,

wie kann ich einem Formular, das in einer dll erzeugt wird. ein Icon zuweisen?

hoika 19. Jun 2007 16:06

Re: dll Formular Icon zuweisen
 
Hallo,

da ich das gerade selber gesucht habe,
rumprobiert GELÖST haben
hier mal die Lösung

Delphi-Quellcode:

uses
  Windows;

{$R MyIcon.Res}  // oder als RC
procedure ExecuteForm; // die Methode wird von der importierten proc aufgerufen
var
  theIcon : hIcon;
begin
  theIcon:= LoadIcon(HInstance, 'ICON1');
  Application.Icon.Handle:= theIcon;

  Form:= TForm.Create;
  try
    Form.ShowModal;
  finally
    Form.Free;
  end;

  DestroyIcon(theIcon);
end;

Heiko

AirJordan 3. Dez 2007 16:08

Re: dll Formular Icon zuweisen
 
Hallo,

ich suche ebenfalls nach einer Lösung zum Anzeigen einer Icon Datei in einer DLL. Das Beispiel oben
habe ich probiert. Ich bekomme im Form oben links auch ein Icon angezeigt.

Wenn ich aber mit ALT-TAB von einer Anwendung zur nächsten springe, hat meine Anwendung kein Icon mehr. :gruebel:

Muss man das vielleicht noch an einer anderen Stelle eintragen?

Grüße
Holger

AirJordan 5. Dez 2007 22:03

Re: dll Formular Icon zuweisen
 
*push*

Hat keiner eine Idee oder tritt dies nur bei meinen DLL mit Formularen auf?


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:25 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz