Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879070 Posts in 32956 Topics- by 24353 Members - Latest Member: kanki

May 23, 2013, 07:23:50 AM
TIGSource ForumsDeveloperTutorialsMaking your ".exe" have an icon using MSVC++ Express/Notepad
Pages: [1]
Print
Author Topic: Making your ".exe" have an icon using MSVC++ Express/Notepad  (Read 3126 times)
nitram_cero (2bam)
Level 10
*****


DIY


View Profile WWW Email
« on: July 28, 2009, 02:43:05 PM »

It's a quick and really easy tutorial.

Doesn't have much to do with games really, it's just that I hate the default "white square" exe icon. So, if you make a C++ game for Windows using MSVC, there is NO excuse.

http://blog.tbam.com.ar/2009/07/how-to-add-icon-to-your-windows.html

Hope you like it.

BTW: Please tell me about any typos or engrish.
Logged

2BAM.com indie games
brog
Level 7
**



View Profile WWW
« Reply #1 on: July 28, 2009, 02:59:56 PM »

Thanks, I've been meaning to find out how to do this for a while.  And now it's done!

(plus I now know how to add other resources too - awesome!)
Logged
Glaiel-Gamer
One Epic Motherfucker
Level 10
*


Stoleurface!


View Profile WWW Email
« Reply #2 on: July 28, 2009, 03:05:09 PM »

is there a way to package resources into the .exe like how mac apps have the .app folder type?
Logged

David Pittman
Level 2
**


caffeine?? NO!!


View Profile WWW Email
« Reply #3 on: July 28, 2009, 03:07:17 PM »

Manually creating the .rc file seems sort of hacky. Just right-click on your project in the Solution Explorer, Add -> Resource... and let VS generate the .rc file and assign IDs for whatever resources you embed.

Edit: My bad, Express edition removes this functionality.
« Last Edit: July 28, 2009, 09:29:43 PM by David Pittman » Logged

Games: Davy - SecOrd - TKtics - GRO - Cutie - CC1984 - SV
Alevice
Level 10
*****



View Profile WWW
« Reply #4 on: July 28, 2009, 03:44:26 PM »

Yiou could use reshacker too, I guess.
Logged

nitram_cero (2bam)
Level 10
*****


DIY


View Profile WWW Email
« Reply #5 on: July 28, 2009, 05:39:00 PM »

brog:
You're welcome!

Glaiel-Gamer:
I never made anything for the Mac, so I don't really know what you're talking about.
In Windows you can embed resources inside the executable, generally GUI stuff like bitmaps, cursors, menues, icons, etc...
I think you can also put raw binary stuff, but I'm not sure how.
But you can't access them as files, you need to extract them with some Windows specific functions. On the other hand, you can use them almost directly for GUI stuff like setting cursors, a bitmap background, etc.

David-Pittman
I don't think it's hacky. It's just knowing the Resource Compiler language (Which is absolutely straight forward)

Resources can't be added like that in Express editions. Express editions specifically come without a resource editor just to piss you off (I don't see other reason, not even commercially)

Abraham Jones:
Using reshacker each time you change a bitmap is a bit of a drag. You have a point because you're not going to change icons a whole lot, but I just find it easier to write one line in notepad.

I tried ResEdit, that's supposed to work for MSVC++ 2008, but it just didn't work out of the box for me.
« Last Edit: July 28, 2009, 05:42:51 PM by nitram_cero » Logged

2BAM.com indie games
Cthulhu32
Level 6
*


Brawp


View Profile WWW Email
« Reply #6 on: July 31, 2009, 11:57:26 AM »

Quick note: this is how it is done in almost every Dev application I've used. I tend to gravitate toward Code::Blocks cause its free and not Microsoft for my indie projects, and creating icons for exes is EXACTLY the same. I usually flesh them out and bring them to live in GIMP, then use IcoFX to create the icon.
Logged

nitram_cero (2bam)
Level 10
*****


DIY


View Profile WWW Email
« Reply #7 on: July 31, 2009, 06:26:46 PM »

Great!

I just posted a mini-tutorial because it took me a while to figure it out, to avoid the hassle to others.

Regards
-Martín
Logged

2BAM.com indie games
mcc
Level 10
*****


glitch


View Profile WWW Email
« Reply #8 on: August 01, 2009, 06:32:05 PM »

Also if it's useful to anyone here are similar instructions for MinGW.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Jack Gleeson
Level 2
**

jackoglee@hotmail.com
View Profile WWW Email
« Reply #9 on: August 07, 2009, 07:00:31 AM »

Hmm, it's a lot easier in MonoDevelop. Just right click on the project then choose general build options and there's a file browser to choose it.
Logged

Website

Formerly known as ACardboardRobot.
AlexRamallo
Level 0
**


.:Snakeinalake Studios:.


View Profile WWW Email
« Reply #10 on: August 13, 2009, 06:03:49 AM »

thanks this is awesome! that white square makes games look unprofessional, maybe now more people will play my games Tongue
Logged

Android<3
Impossible
Level 3
***



View Profile Email
« Reply #11 on: August 13, 2009, 08:43:58 AM »

[quote author=nitram_cero link=topic=7491.msg238439#msg238439 date=1248831540
I tried ResEdit, that's supposed to work for MSVC++ 2008, but it just didn't work out of the box for me.
[/quote]

I've had success with ResEdit.  I don't remember it being that tricky.
Logged
nitram_cero (2bam)
Level 10
*****


DIY


View Profile WWW Email
« Reply #12 on: August 13, 2009, 12:41:34 PM »

It didn't work for me, the generated .rc made an inclusion of resource.h that in turn defined my identifiers as numbers.

As the RC compiler uses the C-precompiler (#define, etc...), then the "names" of the resources ended up being numbers. And that doesn't work with FindResource or wxWidgets Icon/Bitmap constructors Smiley

But your mileage may vary!

I remember sending a mail to the author pointing this out but never got a reply.

Regards
-Martín
Logged

2BAM.com indie games
William Laub
Level 10
*****


Gold Cray


View Profile WWW Email
« Reply #13 on: August 13, 2009, 01:25:29 PM »

Hmm, it's a lot easier in MonoDevelop. Just right click on the project then choose general build options and there's a file browser to choose it.
I just checked this out with Dev-Cpp, and it's about the same: Project->Project Options->browse.
Logged

Digital Modular Theremin: A new KiNd of Theremin<br />C C++ Python Verilog Java VBA C# Fortran
nitram_cero (2bam)
Level 10
*****


DIY


View Profile WWW Email
« Reply #14 on: August 14, 2009, 06:17:47 AM »

I don't mean to be rude, but... the title specifically says "using MSVC++"

You can probably do it a thousand ways, I just wanted to contribute my way for Visual Studio Express, as it took me some time to figure it out.

Regards
-Martín
Logged

2BAM.com indie games
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic