Re: Loading an icon from another .exe or .dll file

On Thu, 27 Apr 2006 08:42:01 -0700, Kellie Fitton wrote:


Have you used the following Win32 APIs:




Thanks for the tip, I will look into that.

I also found the following bizarre documentation on the ExtractIconEx
function (strangely, this text only appears on the WinCE version?):

[in] Specifies the zero-based index of the first icon to extract. For example, if this value is zero, the function extracts the first icon in the specified file.
For Windows CE 2.10 and later, the nIconIndex parameter must be zero or ?N, where N is a specified resource identifier. The nIcons parameter must be 1.

For Windows CE 1.0 through 2.10, the function returns the total number of icons in the specified file if nIconIndex is ?1 and phIconLarge and phiconSmall are both NULL. If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ICO file, the return value is 1.

So it seems that the WinCE version will allow you to set the nIconIndex
parameter to be negative, and this implies that the absolute value of the
icon index is actually a resource ID. Bizarre.