Embed Icon in EXE

Embed Icon in EXE

Postby Ollie » Sun Mar 04, 2007 11:32 am

How do I imbed an Icon into my EXE?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Re: Embed Icon in EXE

Postby Enrico Maria Giordano » Sun Mar 04, 2007 11:44 am

Just add it to your .RC or .RES resource file.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Sun Mar 04, 2007 1:02 pm

myicon ICON myicon.ico
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ollie » Thu May 31, 2007 8:45 pm

Please give me more detail on this...

I have all my BitMAPS, DIALOGS, ICONS stored in a DLL (CS.DLL)

I have a line in my code:
SET RESOURCES TO "CS.DLL"

And I am able to use the BITMAPS etc. in other parts of the program.

What do I need to show my icon CS.ICO in the taskbar of windows and title bar of my app. I don't know how to use .RC or .RES files.

Using FWxH, xHb 99.60 BCC5.51 iLink32.EXE XMate 1.15
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby yury » Thu May 31, 2007 8:58 pm

hello,

in title of window application:

if you have a icon file:

Code: Select all  Expand view
DEFINE ICON oICON FILENAME "yourIcon.ico"

DEFINE WINDOW oWINDOW FROM 1,1 TO 20,70 MDI;
           COLORS CLR_BLACK,CLR_WHITE;
           MENU BUILDMENU() ;
           ICON oICON ;
           TITLE "YourTitleAplication"


if you have a icon in resource or dll file:

Code: Select all  Expand view
DEFINE ICON oICON RESOURCE "yourIcon"

DEFINE WINDOW oWINDOW FROM 1,1 TO 20,70 MDI;
           COLORS CLR_BLACK,CLR_WHITE;
           MENU BUILDMENU() ;
           ICON oICON ;
           TITLE "YourTitleAplication"



regards
Yury Marcelino Al
yury030575@yahoo.com.br
vimansca@vimansca.com.br
Leme / SP - Brasil
yury
 
Posts: 56
Joined: Wed May 23, 2007 2:01 pm

Postby Ollie » Thu May 31, 2007 10:11 pm

PERFECT - Thanks! :D
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Ollie » Thu May 31, 2007 10:17 pm

Its interesting that the ICON doesn't appear next to the EXE in Windows Explorer - its the blank unknown application icon. (It appears in my application though.) Why is that?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Antonio Linares » Thu May 31, 2007 10:31 pm

Create a RC file and add this line:

1 ICON "your_icon.ico"

Then compile it and place it into the EXE, as samples\buildx.bat does

Then your EXE will be shown in the explorer with its icon
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Rick Lipkin and 41 guests