TIP: Click on subject to list as thread! ANSI
echo: delphi
to: JOAQUIM HOMRIGHAUSEN
from: MICHAEL THOMSEN
date: 1997-10-24 21:10:00
subject: Icons (Delphi 1.x)

Hello Joaquim Homrighausen!
   Quoting: Joaquim Homrighausen to All
Written on: 23-Oct-97 at: 09:27:29
   Subject: Icons (Delphi 1.x)
 JH> What is the correct procedure for setting/changing the icon of a window?
 JH> No matter what I try, Delphi refuses to update the icon or show the
 JH> correct icon when the window is minimized.
This should do the trick:
procedure T.SetIcon;
var
  Icon : TIcon;
begin
  Icon := TIcon.Create;                           { Create Icon }
  Icon.Handle := LoadIcon(HInstance, 'iconname'); { Load Icon }
  Application.Icon := Icon;                       { Assign new Icon }
  InvalidateRect(Application.Handle, nil, true);  { Repaint app.icon }
    Icons[A].Free;                                { Free memory }
end;
Regards 'n' stuff,
    Michael Thomsen, Birkerod / Denmark    FiDO-net: 2:236/447.30
                   Team NUAF * Team EBM      E-MAIL: thomsen@mailhost.net
--- Terminate 3.00/Pro
2:236/447.30)
---------------
* Origin: Do it right do it /2 - Do it wrong do it 95 times...

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.