...get the Icon from another Window?

Author: Thomas Stutz

Category: Graphic

{
{
First Start Notepad.exe and run this code:
Starte zuerst Notepad.exe und führe dann diesen Code aus:
}

procedure TForm1.Button1Click(Sender: TObject);
var
  hwindow : THandle;
  H: HIcon;
begin
  hwindow := FindWindow('notepad',nil);
  H := CopyIcon(GetClassLong(hwindow, GCL_HICON ));
  DrawIcon(Canvas.Handle, 30, 30, H);
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base