Dark Bit Factory &  Gravity

Dark Bit Factory & Gravity

  • September 03, 2010 *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Pages: [1]   Go Down

Author Topic: Adding An Icon To Your Executables!  (Read 2247 times)

0 Members and 1 Guest are viewing this topic.

Clyde

  • A Little Fuzzy Wuzzy
  • Contributing Author
  • Senior Member
  • ******
  • Karma: 71
  • Offline Offline
  • Posts: 6971
    • View Profile
Adding An Icon To Your Executables!
« on: July 06, 2009 »
Introduction:
As the topic implies this little thang will allow you to add an identity to your FreeBASIC proggies.


What You'll Need:
An icon image file .ico - A few are supplied to Transform your .exe's, see zip attachment.
A text editor Note Pad is just grand.
Optional: A paint package that allows the ability to churn out .ico files or better still an icon editor.


Before We Start:
By adding an icon it will increase your overall program file size.

I've supplied a zip archive of some icons for you to have a play with, there are a lot of freebies available if you search the web for them.

Also use icons in the size of 32 by 32. I've tried with bigger sizes but they get resized when the object file is created and your program is compiled.


Lettuce Begin:
First of all save / copy and paste your icon into the program you wish to add the particular icon to, if you want to add it to your media / graphics folder than just remember to put the directory path into the icon file location.

Now open up Notepad or your prefered weapon of choice in the text editor department and type in the following:

Code: [Select]
fb_program_icon icon "name_of_icon.ico"

Nows time to navigate to save, and select to save it as all types of files in the drop down menu, important this part, otherwize you'll be creating a text document rather than the actual type of file we need.

And call it a suitable name, for example add_icon followed by a dot rc and make sure you save it into your main programs root directory.


And Finally!
In FBIDE -> View -> Settings -> FreeBASIC

Under Compiler Command in the tab along side your usual compiler settings, at the end enter in quotes "add_icon.rc" ( By the way same similar scenario with compiling on the command prompt )

And now OK it, when you next compile with F9 ( not F5 ) your program executable should now have a neat piccie applied!!


Extra Extra!:
Ico FX - free icon utility and really awesome allows you to import your own images and apply settings to convert into icons. Thanks to Xone for posting the link in another thread.

Known Issues
If you are using fbgfx lib then you will see a smaller icon on your windows title bar when not in full screen mode. However in TinyPTC / TinyPTC_Ext you will just have an icon applied to your exe.

Cheers and Happy Coding,
Clyde.
« Last Edit: July 08, 2009 by Clyde »
Logged
If only I knew then what I know now.

DrewPee

  • I Toast Therefore I am
  • Sponsor
  • Pentium
  • *******
  • Karma: 25
  • Offline Offline
  • Posts: 544
  • Eat Cheese - It's good for you!
    • View Profile
    • WWW
Re: Adding An Icon To Your Executables!
« Reply #1 on: September 09, 2009 »
Nice one Clyde - didn't know you could do that! ;)   :goodpost:
Logged
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

Clyde

  • A Little Fuzzy Wuzzy
  • Contributing Author
  • Senior Member
  • ******
  • Karma: 71
  • Offline Offline
  • Posts: 6971
    • View Profile
Re: Adding An Icon To Your Executables!
« Reply #2 on: September 23, 2009 »
Thanks Man and now you do!! ;)
Logged
If only I knew then what I know now.

bobfresh

  • C= 64
  • **
  • Karma: 5
  • Offline Offline
  • Posts: 37
    • View Profile
Re: Adding An Icon To Your Executables!
« Reply #3 on: March 03, 2010 »
Quick side note/question.

If I try adding an XP+ manifest to the executables resource section, it generates a program error!!
added: the error is in the generated exe not in GoRC or FBC. also the same problem is not repeatable in my other language -masm32.

Conveniently i found a picture that depicts the effect on the exe alot better than i could describe it...

it looks a bit like this....  :boxer:   

Does anyone have a fix for this that doesn't involve adding a myprog.exe.manifest to the directory?

thx in advance - bob
« Last Edit: March 03, 2010 by bobfresh »
Logged

rbz

  • MOD
  • Senior Member
  • *******
  • Karma: 272
  • Offline Offline
  • Posts: 2138
    • View Profile
    • WWW
Re: Adding An Icon To Your Executables!
« Reply #4 on: March 03, 2010 »
I'm not sure but maybe you're using a wrong manifest file?

Check this out, I used some examples found here and here.



Logged
rbz ^ Codigos

Clyde

  • A Little Fuzzy Wuzzy
  • Contributing Author
  • Senior Member
  • ******
  • Karma: 71
  • Offline Offline
  • Posts: 6971
    • View Profile
Re: Adding An Icon To Your Executables!
« Reply #5 on: March 03, 2010 »
I see, a password system.
Logged
If only I knew then what I know now.

bobfresh

  • C= 64
  • **
  • Karma: 5
  • Offline Offline
  • Posts: 37
    • View Profile
Re: Adding An Icon To Your Executables!
« Reply #6 on: March 12, 2010 »
rzb yup that fixed it alright.

I was using an old hacked up XP manifest that ive been using for years on masm32 w/ no issues. Strange that it only kicked off when embedded in the RSRC section though... meh.  I only need windows to 'skin' the std controls like buttons and listboxes .etc. so that example is perfect.

          Thanks for that.
« Last Edit: March 12, 2010 by bobfresh »
Logged
Pages: [1]   Go Up
 

 

B l a c k R a i n V.2 by C r i p

Page created in 0.138 seconds with 19 queries.