Mega Code Archive

 
Categories / Delphi / Graphic
 

Get the icon from another window

{ { 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;