Monday, February 08, 2010

Setting Icon for Win32 Console Applications

Here is a scenario..
  • You create an application with Visual Studio Express 2008 (or some other express thing)
  • You created a win32 console application (so that you dont' have to deal with win32 api)
  • You want to set a custom icon for your app (instead of the generic .exe icon that shows up)
Sounds Simple right, but took me a while to figure out the solution, but as it turns out is pretty easy to do. Here are the steps you have to follow
  • Add a new (.rc) file to project (empty file)
  • add the following line to the .rc file you just added to the project
IDI_ICON1 ICON DISCARDABLE "customicon.ico"
  • Copy the customicon.ico file to source code directory of the project.
  • Build your application just like you would normally. (using the menu options in VC Express)
  • Check the .exe created in the release/debug folder based on your configuration.
Well i tried to put it as simple as i could, Hope you found this useful, here are the links which helped me figure out how its' done .. just in case you dont' understand what i wrote here..
Post a Comment