Re: Win32Lib: Window Icon

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

Brian Broker writes:
> Just wondering if there is a better way to do this...
> I want to bind a program with a custom icon and have
> that icon be displayed in the corner of my window.
> I am using the following code.
>
> -- start snippet --
> sequence cl
> cl = command_line()
> setIcon( MyWindow, cl[2] )
> -- end snippet --
>
> This assures that the icon will show up in my window
> regardless of what the executable is named.

You should look at euphoria\demo\win32\window.exw
in the Euphoria 2.2 release. It contains the code
that you need to display an icon in the top left corner
of a window. The 3 key lines are:

icon_handle = c_func(LoadIcon, {instance(), allocate_string("exw")})
poke4(wndclass + hIcon, icon_handle)
poke4(wndclass + hIconSm, icon_handle)

The standard icon contained in exw.exe for 2.2 is
called "exw" regardless of what you call your bound .exe file.
When you run bindw, you can specify an icon of your own,
but the name will still be "exw".

Your icon must contain a single image, and be 2238 bytes
or less in size, otherwise it might not be displayed. (see bind.doc)

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu