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 TIcon.Handle readonly progleme (https://www.delphipraxis.net/84043-ticon-handle-readonly-progleme.html)

day 10. Jan 2007 14:54


TIcon.Handle readonly progleme
 
hallo,
Ich habe folgendes problem. Die variable Handle ist als readonly deklariert. Wie kann ich den handle des icons dem TIcon zuweisen?


Delphi-Quellcode:
Var
  w: Integer;
  Icon: TIcon;
  IcoHandle: HIcon;

Begin
  // memchk;
  Icon := TIcon.Create;
  Try
    IcoHandle:= ExtractIcon(hinstance, pchar(paramstr(0)), 0);
    Icon.Handle := IcoHandle;
    Application.Icon.Assign(Icon);
  Finally
    Icon.Free;
  End;

shmia 10. Jan 2007 15:21

Re: TIcon.Handle readonly progleme
 
Zitat:

Zitat von day
Ich habe folgendes problem. Die variable Handle ist als readonly deklariert.

Das stimmt doch gar nicht (zumindest nicht bei Delphi 5 +)
Hier der Beweis: (gekürzter Sourcecode)
Delphi-Quellcode:
  TIcon = class(TGraphic)
  private
    function GetHandle: HICON;
    procedure HandleNeeded;
    procedure SetHandle(Value: HICON);
  protected
   ...
  public
    ...
    property Handle: HICON read GetHandle write SetHandle;
  end;

day 10. Jan 2007 16:16

Re: TIcon.Handle readonly progleme
 
Bei delphi 7 schon.....
Delphi-Quellcode:
    property Handle: QPixmapH read GetHandle;
gibts dazu eine alternative?

Luckie 10. Jan 2007 21:29

Re: TIcon.Handle readonly progleme
 
Was ist denn das für ein Datentyp: QPixmapH :gruebel: Kann es sein, dass du CLX-Units eingebunden hast?


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

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