- Subject: Re: How to get the app icon?
- From: Chris Hill <hillca@cs.purdue.edu>
- Date: Thu, 28 May 1998 17:47:35 -0500
Window classes are not required to have an icon. If you look at line
4387 of the forms.pas in the VCL source, you can see that 0 was passed
as the handle of the icon in the call to CreateWindow. The icon is
actually set later (line 4993) using SendMessage(..., WM_SETICON, ...).
The icon is loaded from resources. Icons can be dynamically set.
To get the icon handle of any window, you should use
Icon->Handle = (HICON)SendMessage(WinHandle, WM_GETICON, ICON_SMALL, 0);
Note that in the case of the application window there is no small icon,
only a large one.
Icon->Handle = (HICON) SendMessage(Application->Handle, WM_GETICON, ICON_BIG, 0);
--
Chris Hill
hillca@cs.purdue.edu