Re: Changing an associated icon




JamesR wrote:
<snip>

MyTIcon.Handle := LoadImage(hInstance, 'ICONNAME', IMAGE_ICON, 0, 0,
LR_DEFAULTSIZE);

- This again only saves the 32x32. Well if you're wondering if the
multipage icon has included in the resource correctly, like I mentioned
- another class works at extracting the multipage just fine, so it's a
case of trying to use something to get the multipage one extracted.

Have you seen the LoadImage API description ? The fourth & fifth
parameters (Icon size) is specified as follows ..

cxDesired
[in] Specifies the width, in pixels, of the icon or cursor. If this
parameter is zero and the fuLoad parameter is LR_DEFAULTSIZE, the
function uses the SM_CXICON or SM_CXCURSOR system metric value to set
the width. If this parameter is zero and LR_DEFAULTSIZE is not used,
the function uses the actual resource width.

cyDesired
[in] Specifies the height, in pixels, of the icon or cursor. If this
parameter is zero and the fuLoad parameter is LR_DEFAULTSIZE, the
function uses the SM_CYICON or SM_CYCURSOR system metric value to set
the height. If this parameter is zero and LR_DEFAULTSIZE is not used,
the function uses the actual resource height.

.... and the sixth parameter description is ...

fuLoad
[in] This parameter can be one or more of the following values.
Value Meaning
LR_DEFAULTCOLOR The default flag; it does nothing. All it means is "not
LR_MONOCHROME".

LR_CREATEDIBSECTION When the uType parameter specifies IMAGE_BITMAP,
causes the function to return a DIB section bitmap rather than a
compatible bitmap. This flag is useful for loading a bitmap without
mapping it to the colors of the display device.

LR_DEFAULTSIZE Uses the width or height specified by the system metric
values for cursors or icons, if the cxDesired or cyDesired values are
set to zero. If this flag is not specified and cxDesired and cyDesired
are set to zero, the function uses the actual resource size. If the
resource contains multiple images, the function uses the size of the
first image.

LR_LOADFROMFILE Loads the image from the file specified by the lpszName
parameter. If this flag is not specified, lpszName is the name of the
resource.

LR_LOADMAP3DCOLORS Searches the color table for the image and replaces
the following shades of gray with the corresponding 3-D color:

This seems to explains why you could get only the first image in the
file. You would have to get the others by specifying the size
(cxdesired & cyDesired) you want.

Alan Lloyd

.



Relevant Pages

  • Re: Proper use of #getImageBlock in runtime [LONG!]
    ... When Dolphin reads an icon or bitmap, ... It can load it from a "resource" embedded in an executable file ... where the FileLocator is an instance of one of the subclasses of FileLocator ... We can define a PackageRelativeFileLocator which includes the name of a package ...
    (comp.lang.smalltalk.dolphin)
  • HLA v2.x and / or LASM suggestion: Win32 Resources
    ... With Microsoft's RC compiler, I've just noticed that it's less capable ... binary resource converted into readable, ... possible to create an icon or bitmap on-the-fly in the actual program ... make a separate tool and then all of them can share ...
    (alt.lang.asm)
  • Re: Single use of ICON in all forms
    ... > "Icon", but the Icon class does not have a FromStreammethod. ... > "Matt Berther" wrote in message ... >> Embedding the file as a resource is no big deal... ... Embedding it as a resource would still leave me with two ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Application icon
    ... Regards ... > this, you can create a resource compiler script file for the icon, and ... > create a resource file by using the Rc.exe utility. ... use the following code to create a resource compiler script ...
    (microsoft.public.dotnet.vjsharp)
  • Re: net use command
    ... Specifies the next available drive letter. ... specifies to disconnect all of your connections. ... computer Specifies the name of the computer sharing the resource. ... /YES Carries out the NET USE command without first prompting you to ...
    (microsoft.public.windowsxp.network_web)