Friday, July 31, 2009

How to change the icon of a exe file created using C program?

The executable file created by compiling a C source code has the common blue block icon. How can it be changed to colour ful icons which i create.

How to change the icon of a exe file created using C program?
If you don't specifically include an icon in your .exe file when you compile your program, Windows will provide a default icon for it. (Windows doesn't include the icon within the file itself - it just displays that icon when you're looking at the file in Explorer or on the desktop.)





You don't mention which compiler you're using.


Anyway, you need to include a resource file (.RC) which names the icons you wish to include or the icon data itself.





This is a rather long explanation so I'll only point to where you should look. Look in the Windows SDK documentation and your compiler's help files regarding the "RegisterClass" Windows function and about resource files. All the compiler IDEs for Windows out there make it easy to include resources (icons, pictures, wav files, etc.) in your .exe files.





P.S.


If you don't mind some advice:


If you're learning to program in Windows, I highly suggest "Programming Windows" by Charles Petzold, published by Microsoft Press. It is the de facto book for learning to program Windows. I learned to program Windows 3.1 and Windows 95 with his books. (You certainly do NOT want to learn Windows programming with the stupid object oriented libraries included with your compiler.)
Reply:check this address





http://mediasrv.ns.ac.yu/extra/fileforma...
Reply:You can change the icon of the EXE in Windows by going to its Properties and setting an icon for it. But that would be local to that system only.
Reply:After your executable is created, right click on it (shortcut). select properties. You should see Change Icon for the shortcut. There you select the required icon.
Reply:I think you can't modify the default icon for exe files. However you can modify icon of shortcut files by selecting properties from right click menu and then clicking on change icon for shortcut.


No comments:

Post a Comment