Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change app icon in Visual Studio 2005?

I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can make Visual Studio use a different icon for the app Icon in the demo config but continue to use the regular icon for the full version's config?

like image 691
CariElf Avatar asked Sep 16 '08 14:09

CariElf


People also ask

How do I change the icon for a program in Visual Studio?

On the menu bar, choose Project > Properties. When the Project Designer appears, choose the Application tab. (Visual Basic)—In the Icon list, choose an icon (.

How do I change the application icon in winform?

Creating Desktop Applications Using Windows Forms You can change the icon in Visual Studio by opening the properties window for the form. You can then upload a new icon image to the icon field.


2 Answers

According to this page you may use preprocessor directives in your *.rc file. You should write something like this

#ifdef _DEMO_VERSION_
IDR_MAINFRAME ICON "demo.ico"
#else
IDR_MAINFRAME ICON "full.ico"
#endif
like image 81
Serge Avatar answered Sep 30 '22 19:09

Serge


What I would do is setup a pre-build event (Project properties -> Configuration Properties -> Build Events -> Pre-Build Event). The pre-build event is a command line. I would use this to copy the appropriate icon file to the build icon.

For example, let's say your build icon is 'app.ico'. I would make my fullicon 'app_full.ico' and my demo icon 'app_demo.ico'. Then I would set my pre-build events as follows:

Full mode pre-build event:

del app.ico | copy app_full.ico app.ico

Demo mode pre-build event:

del app.ico | copy app_demo.ico app.ico

I hope that helps!

like image 26
Kevin Avatar answered Sep 30 '22 20:09

Kevin