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...
|