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