How can I change my program's icon for anyone who uses the program? Obviously I would have to include the .ico file with it, but beyond that, I'm stumped.

Recommended Answers

All 10 Replies

Typically the main icon is linked in at compilation. How exactly you do it depends on your compiler. In all cases, a Windows resource named MAINICON is in your exe.

You can also check out Resource Hacker, which you can use to manually change a program's icon.

How would I add it in with Code::Blocks? I can't figure it out

I don't know.

If you know how to link windows resources to your project, create an icon resource named MAINICON.

Otherwise you'll have to use resource hacker.

Good luck!

Its possible to do, ive never tried this but I think it should work.

SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(NULL,
MAKEINTRESOURCE(ICON_ID)));

ive never tried

If you've never tried, then try.
It takes 2 seconds...

No it doesn't, you have to create a Win32 project, make a window and then make it change the icon at runtime.. The point is I dont need to try it because im not the one with the problem, hes the one who should be putting in the effort to test it, im just giving suggestions.

Is there a simple way to do this in Dev-Cpp? There doesn't seem to be an area to compile linked .ico's into the project. I have tried using IconFX but it cannot add icons to a project that has already been compiled.

To dmanw100...

You can do it in Dev C++.Create a project & then go to Project->Project Options & in the "General" page you will find Icon Option for your project(for the .exe).

Done..!!

can anyone suggest me, I want to change my icon according to particular flag
For example : In a project, I want to use 2 icon but accrding to one particular flag in mfc c++...please reply?????

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.