RE: what's up with extractIcon() ?

new topic     » topic index » view thread      » older message » newer message

Derek Parnell wrote:
> Hi Shahar,
> there are two issues involved.
> 
> The first is that when a picture button is created, it is set to hold 
> either an icon or a bitmap. If set to an icon, you cannot load bitmaps 
> into 
> it and visa versa. The determining factor is the "flags" parameter on 
> the 
> create() statement you used.  If that parameter is the name of an .ICO 
> file 
> then the picturebutton will be able to hold icons, otherwise it will 
> hold 
> bitmaps.
> 
> This means that setIcon() will only change the picture button if it was 
> created to hold icons.
> 
> The other issue is a bug in setIcon. If you pass this routine an atom, 
> and 
> the control is not a Window (eg, a picturebutton) it will attempt to 
> load 
> one of the standard Windows icons into the picturebutton. However, if 
> the 
> atom is NOT the correct id of a standard Windows icon, the program may 
> crash or do some other unexpected thing.
> 
> To fix setIcon() for now, find the lines in the routine that look like 
> ...
> 
>    else
>        -- use LoadIcon to load a Windows icon resource
>        handle = w32Func(xLoadIcon, {NULL, icon})
> 
> and replace them with these lines...
> 
>    elsif icon >= 32512 and icon < 32517 then
>        -- use LoadIcon to load a Windows icon resource
>        handle = w32Func(xLoadIcon, {NULL, icon})
>    else
>        handle = icon
> 
> 
> As for extractIcon, there is nothing seemingly wrong with this.
> 
> Imagelists do not apply to picturebuttons.  Are you using picture 
> buttons 
> on a FlatToolbar or a Toolbar?
> 
> I hope this helps.
> 
> 
> On Sun, 24 Nov 2002 23:08:25 +0000, Shahar Siman - tov 
> <shahar98 at bezeqint.net> 
>  wrote:
> 
> >
> > How is extractIcon() supposed to work? I try to use the handle that 
> > extractIcon() 
> > returned as a parameter for setIcon(), but I get no result. How are 
> > imagelists connected to all this? the documentation is not clear enough 
> > about this.
> >
> ---------------
> cheers,
> Derek Parnell
> 
> 
Hi Derek

Thank you for you response. it is very informative. I'm 
using a single picture button on a window, not in a toolbar or
a flat toolbar. 
I'm actually interested in managing icons and 
saving them in a euphoria database. Is there a way to manage 
the contense of the icon directly, not through handles, or 
does it require a lot of "dirty" windows code?

either way, your information has been very helpful
Shahar

shahar98 at bezeqint.net

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu