Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411855 Posts in 69423 Topics- by 58465 Members - Latest Member: joelmendonca

June 02, 2024, 02:47:54 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsMaking 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 6342 times)
Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« 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

Working on HeliBrawl
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
Guest
« 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
**


MAEK GAEM


View Profile WWW
« 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

Alevice
Level 10
*****



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

Yiou could use reshacker too, I guess.
Logged

Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« 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

Working on HeliBrawl
Cthulhu32
Level 6
*


Brawp


View Profile WWW
« 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

Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« 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

Working on HeliBrawl
mcc
Level 10
*****


glitch


View Profile WWW
« 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
AlexRamallo
Level 1
*


:0


View Profile WWW
« Reply #9 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

Impossible
Level 3
***



View Profile
« Reply #10 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
Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« Reply #11 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

Working on HeliBrawl
Gold Cray
Level 10
*****


Gold Cray


View Profile WWW
« Reply #12 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
Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« Reply #13 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

Working on HeliBrawl
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic