Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tricky: custom icon for console application 2

Status
Not open for further replies.

tellmehow

Technical User
Feb 14, 2005
3
DE
Hello,

I already asked a lot, but found no solution:

The 'Application settings' under project options for my console application are greyed out.
As someone suggested, I tried adding a .rs file to the project, containing
Code:
#define ID_ICON 101
ID_ICON ICON "nwstarter.ico
But the icon built into the applications .exe still was borlands default icon.
(using a wrong filename provoked a compilation error, so the .rc must have been interpreted somehow ..?)
And sadly, I can't find a description of the .rc files syntax, so the meaning of 101 remains hidden to me.
(tried some other numbers already .. whew ..)

Besides wanting to use my custom icon for console applications, I would really like to find out, how an .exe file can be structured, where meta-information is located, etc..
However, yet I haven't even found the right keywords for search terms.

thanks for any input!
 
tellmehow,
I had the same problem, but no time to investigate it, so I used dirty trick - compiled the code with default icon, then used Resource Hacker ( and replaced the icon.

Anyway, now I have tried doing it programmers way and it worked. The steps were:

1. Create myres.rc file containing following line :
1 ICON "smiley-09-XRSH.ico"

2. Compile myres.rc to myres.res by opening it in builder and using Project -> Compile unit.

3. Remove from project default .res (Project2.res) file and add myres.res (Project -> Add/Remove to/from project)

4. Build it.

The icon has changed to my custom smiley-09-XRSH.ico.
Hope that helps.
 
To set a icon for a project i use "Project"->"Options..."->"Application"-tab and then load the Icon. Simple as that.

Totte
Keep making it perfect and it will end up broken.
 
Totte,
this option is greyed out for console apps. At least in my BCB 6 it is.

M.
 
Yup, my BCB6, personal version greyes out application settings for console applications.
Perhaps a professional version doesn't?

Anyhow, I'm going to try paskudas suggestion asap!

Till then!
 
Ahaa....sorry. I'm running BCB6 Enterprise.


Totte
Keep making it perfect and it will end up broken.
 
Hello and thanks,

paskudas suggestion did the trick!

I guess the clue is to remove the original .res from the project - simple as that .. ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top