IonicWind Software

IWBasic => General Questions => Topic started by: Andy on November 29, 2014, 04:55:18 AM

Title: SETICON Question
Post by: Andy on November 29, 2014, 04:55:18 AM
Hi,

Now that I've moved onto building projects rather than just single file programs I came across something...

I could not select an icon for the project .exe file, when you compile a single file source there is an option for that, so I decided to use the SETICON function instead for the project.

Now this is what the help file says....

"SETICON(win as WINDOW,handle as UINT)

Description

Sets the icon for the window or dialog.

Parameters

win - Window or dialog.

handle - Handle of new icon returned by the LOADIMAGE function."

I missed using the SETICON command for one of the screens, but never the less the icon was still there for that screen - but can anyone tell me why this should be?

Not complaining because that's how I want it anyway, it's just a puzzle to me.

Thanks,
Andy.




Title: Re: SETICON Question
Post by: LarryMc on November 29, 2014, 06:25:40 AM
what you really want to do is add the icon you want to use to the resource file and give it an ID of I
Title: Re: SETICON Question
Post by: Brian on November 29, 2014, 11:49:49 AM
Confused as always!

The Resource Compiler help puts an ICON resource type number at 3, which works for me (24 bit)

In my latest program, I have a 64x64 icon at 3, and a 16x16 icon at 101, which puts a small icon on the titlebar (256 shades)

I know you should have a lot more sizes and bit depths, but 64x64 works at most view sizes, without bloating the program's size

Brian
Title: Re: SETICON Question
Post by: Andy on November 29, 2014, 11:03:01 PM
Yes,

I'm doing what you and Brian suggest,

I've added it as an Icon resource - ID 27 (that's my last resource)
and the in the main program I load the image:

hIcon = LOADIMAGE(27,@IMGICON)

Then I can use:
SETICON win,hIcon (win is the window).

Thanks,
Andy.


Title: Re: SETICON Question
Post by: Brian on November 30, 2014, 11:06:42 AM
Andy,

As I said, if you add as a Resource, a suitable size icon at ID 3, and a 16x16 icon at ID 101,
you don't need to use LOADIMAGE or SETICON at all, they are just where they should be
when you compile your program

Brian
Title: Re: SETICON Question
Post by: AdrianFox on December 01, 2014, 10:12:48 AM
Thanks for that information Brian.  That is entirely new to me and obviates all the other steps I usually need to take.