#155878 - silent_code - Sun May 04, 2008 11:47 pm
hi,
can anyone give me a hint how to make the window icon show up when using the win32 api (3.14) with gcc (3.5)? i have tried almost everything and it won't show up!
i did it the ms vs style, that works with vs (it's quite well documented), but it won't work with gcc (i know it's not compiler related ;^D ).
what can i do? has anyone a working example? any URLs?
thanks in advance!
Last edited by silent_code on Tue May 06, 2008 12:21 am; edited 2 times in total
#155890 - kusma - Mon May 05, 2008 9:58 am
Uhm, can't you just fill out the hIcon-member of your WNDCLASS-structure (or hIcon and hIconSm if you're using WNDCLASSEX) with a handle to a valid icon (loaded with LoadIcon or LoadImage api functions)?
#155907 - kusma - Mon May 05, 2008 2:47 pm
Check that windowClassEx.hIcon and windowClassEx.hIconSm isn't NULL. I tried at home with my mingw-install right after posting, and it worked just fine. The only difference from what I can see here, was that I loaded the icon from file, not resource (just by using the LR_LOADFROMFILE-flag), as I didn't want to find out how to include resources under mingw ;)
#155910 - silent_code - Mon May 05, 2008 4:12 pm
including resources is easy. write a .rc file, compile it with windres and link it.
well, i'll try loading the damn thing from file, but i really don't want to ship a seperate .ico file when the icon is *obviously* in the .exe. i though i could get around this somehow. :^(
anyway, thanks for the tip. :^D
#155936 - silent_code - Mon May 05, 2008 11:11 pm
oh, kusma, dear kusma, what would i do without you? if there were a third toystory movie, i'd most likely watch it, but...
thanks, i'll check it out asap! :^)
EDIT:
that did it!!!!
i'm going to behave like a man an say: THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU!!!!
(does that count as ascii art?)
no really, thanks! :^)
btw: nice minimal win32 program :^D
thanks, again. ;^)
EDIT2: wooooh, this is soooo cooool! <hopps like a bunny - in a *square*> (is that even healthy?)
for solving this quest, i would give you 50000 xp and 500 gil if i had any of it! ... and a mighty rat-flail on top of it! ;^D
#155939 - kusma - Mon May 05, 2008 11:48 pm
You're welcome, I'm glad it helped :)
Just out of curiosity, what was really wrong?
#155940 - silent_code - Tue May 06, 2008 12:03 am
i'm about to find out. come what may come, i will have to rewrite the whole window handling subsystem.
i just needed a proof of concept. you code compiled and ran right away, so i have an example that i will use later. i really don't have a clue what was wrong there. as i said, the whole window handlig is bogus.
honestly, i have thought of some really "spacey" ways to get that damn icon loaded... good i ask here in the forum, instead of wasting time (again). ;^)
as soon as i find out what was wrong, i'll post it here. :^D
it's 1:00 am, i think i'll be going to sleep... damn, i wanted to record that video for yellowstar... the whole damn thing (multisampling not working because of - guess what?- wndwHndl'g - in one project the setup works, in another it doesn't [not the same code, just the setup. it works in yet another proof of concept]) cost me so much time today. :^C
@ yellowstar: sorry!
#155947 - silent_code - Tue May 06, 2008 12:46 am
you're welcome. one hand washes the other, right? ;^D
make also sure you use that define for the last parameter. :^)
#156177 - silent_code - Wed May 07, 2008 12:56 pm
hahahaha. :^D
no, i wasn't really hopping like a bunny. it was very close to what i felt like, though.
well, i don't play AC, haven't ever, but i play resident evil (offline on my ngc)... bullets anyone? or paper mario... or viewtiful joe or... metroid (samus doesn't even *have* bullest... i bet she could spare and energy tank, though. )
#156765 - silent_code - Tue May 13, 2008 8:56 pm
so, it looks like it's working now... without further changes. i just wonder what the heck happened? i haven't touched a line of code (even with "(HICON__*)")! damn.
what the heck? does anyone have an idea what might have caused that? as i said before, i didn't change anything (code, .rc, .ico, nothing!)
but i'm glad it finally works in all of my projects! ;^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.