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

 JH>> What is the correct procedure for setting/changing the icon of
 JH>> a window? No matter what I try, Delphi refuses to update the
 JH>> icon or show the correct icon when the window is minimized.
 MT> This should do the trick:
[..]
  It didn't - Delphi (or Windows) refuses to update the form. It may very 
well be that the icon has been properly loaded, but the InvalidateRect() call 
doesn't do anything here. I've seen this in a few other places too though, so 
I'm not surprised. This is what the code looks like now:
VAR
  MDIicon :TIcon;
BEGIN
  BorderIcons:=[];
  MDIicon:=TIcon.Create;
  MDIicon.Handle:=LoadIcon(HInstance, '"GoIcon"');
  Icon:=MDIicon;
  MDIicon.Free;
  BorderIcons:=[biSystemMenu, biMinimize];
END;
  This works - but it has the annoying side-effect that the MDI window 
"flashes".
            %JoHo%
            joho@defsol.se
---
---------------
* Origin: Definite Solutions ~/Stockholm, Sweden (2:201/330.3)

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