IonicWind Software

IWBasic => General Questions => Topic started by: aurelCB on May 31, 2010, 04:54:13 PM

Title: SetIcon problem
Post by: aurelCB on May 31, 2010, 04:54:13 PM
Hi..
I have problem with SETICON comand,not work for me- what i do wrong.
from help:
QuoteExample usage

hIcon = LOADIMAGE( "c:\\images\\prog.ico", @IMGICON)
SETICON mywindow, hIcon

i use this command many times in CB and there works fine.
I do this :
UINT iconic
iconic = LOADIMAGE("c:\\absmall.ico", @imgicon)
'----------------------------------------------------------------------------------------
OPENWINDOW w1,winL,winT,MeWidth,MeHeight,@caption|@minbox|@maxbox|@size,0,capmain$,&main
SETICON w1,iconic


I made icon as usual 16x16 in 256 colors.
so what i do wrong?
Title: Re: SetIcon problem
Post by: LarryMc on May 31, 2010, 05:39:31 PM
Is absmall.ico really in the root directory of your c drive?

LarryMc
Title: Re: SetIcon problem
Post by: Copex on June 01, 2010, 03:07:39 AM
*DELETED* @larry sorry didnt read it correctly
Title: Re: SetIcon problem
Post by: hugh on June 01, 2010, 04:59:34 AM
this is the from the users guide



hIcon = LOADIMAGE( "c:\\images\\prog.ico", @IMGICON)
SETICON mywindow, hIcon


so that tells me to create a folder called "images" on drive C:\, and save my icon there.
You have to find were you saved your icon and give the full path

SORRY, Code is from EBasic Reference Manual

Regards
hugh
Title: Re: SetIcon problem
Post by: aurelCB on June 02, 2010, 09:37:56 AM
QuoteIs absmall.ico really in the root directory of your c drive?
Yes larry it is on disk C.
I try all posibile combination but still dont work.
What may cose this problem?
Title: Re: SetIcon problem
Post by: LarryMc on June 02, 2010, 10:49:59 AM
Aurel
attach your ico so I can see if it works for me.

Aslo, did you try it with different icon?

LarryMc
Title: Re: SetIcon problem
Post by: aurelCB on June 02, 2010, 11:47:47 AM
Hi Larry here is this small icon 16x16 in 256 colors.
I try many others and dont work,im totaly confused why dont work?

Title: Re: SetIcon problem
Post by: LarryMc on June 02, 2010, 12:03:28 PM
Aurel
I made a little test program and it worked fine for me.
Try this program on your computer.
UINT iconic
iconic = LOADIMAGE("c:\\absmall.ico", @imgicon)
'----------------------------------------------------------------------------------------
capmain$="test"
window w1
OPENWINDOW w1,0,0,100,100,@caption|@minbox|@maxbox|@size,0,capmain$,&main
SETICON w1,iconic
centerwindow w1
int run =1
waituntil run=0
DELETEIMAGE iconic,@imgicon
CLOSEWINDOW w1
end

SUB main
    IF @CLASS = @IDCLOSEWINDOW
        run=0
    ENDIF
RETURN
ENDSUB


LarryMc
Title: Re: SetIcon problem
Post by: aurelCB on June 02, 2010, 12:13:59 PM
Yes it works now ;)
Thanks Larry i dont know that i must use DELETEIMAGE
mean i know that is this proper way but i dont use this in CB.
I forget about roule for releasing resource to system.
So if i want use similiar in ABasic i must find way to releasing resources on exit.
Title: Re: SetIcon problem
Post by: LarryMc on June 02, 2010, 12:19:56 PM
CBasic also has the DELETEIMAGE command.

LarryMc