Setting the application icons ...

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
h.a.n.d
Posts: 15
Joined: Fri Feb 13, 2009 1:38 pm

Setting the application icons ...

Post by h.a.n.d »

Hi,

I'm back again with a rather advanced question.

How do you set the application icons?


I've read about resources and the .rc compiler and that you can compile the icons into your exe.
That works so far for me, but Windows doesn't use the icon resources correctly!

Here is what I've done:

I have an my.ico file with 12 different icons 16x16, 32x32, 48x48 in all suported color formats.

My resources.rc file looks like this:

Code: Select all

id ICON "path/to/my.ico"
I compile the resources into my .exe at compile time:

windres -I../../_wxWidgets_2.6.2_minGW/include -i ../src/resources.rc -o ../res/resources.o

Linker extra options:
res/resources.o

The resources get compiled correctly into the .exe and Windows shows me my 48x48 icon in the explorer and my 16x16 icon as taskbar icon.
But the default icon for the window caption and for the alt+tab is used!?

What did I do wrong?

Thanks for the help!!!
- h.a.n.d
JeroenP
Posts: 11
Joined: Sat Jun 20, 2009 7:05 pm
Location: Belgium
Contact:

Post by JeroenP »

See the irrlicht source code:

Code: Select all

		// if there is an icon, load it
		wcex.hIcon = (HICON)LoadImage(hInstance, "irrlicht.ico", IMAGE_ICON, 0,0, LR_LOADFROMFILE); 
source: CIrrDeviceWin32.cpp line 327-328


Jeroen (first post :))
Post Reply