Author Topic: Icon for exe file?  (Read 2010 times)

0 Members and 1 Guest are viewing this topic.

Frankolinox

  • Guest
Icon for exe file?
« on: September 18, 2013, 01:32:28 AM »
lalala :)
« Last Edit: October 01, 2014, 08:47:51 AM by Frankolinox »

Charles Pegge

  • Guest
Re: Icon for exe file?
« Reply #1 on: September 18, 2013, 06:47:32 AM »
Hi Frank,

Two tools are required for attaching resources to exe files. They can be found in /tools/compilers

Once an icon is embedded, it will automatically show.

Here are some notes and MS links documenting resource files

Quote
RC KEYWORDS
===========
 
COMMENTS

RC supports C-style syntax for both single-line comments and block comments. Single-line comments begin with two forward slashes (//) and run to the end of the line. The following is an example of a resource statement followed by a single-line comment.
//
/* ... */

PREPROCESSOR

#define   Defines a specified name by assigning it a given value.
#elif   Marks an optional clause of a conditional-compilation block.
#else   Marks the last optional clause of a conditional-compilation block.
#endif   Marks the end of a conditional-compilation block.
#if   Conditionally compiles the script if a specified expression is true.
#ifdef   Conditionally compiles the script if a specified name is defined.
#ifndef   Conditionally compiles the script if a specified name is not defined.
#include   Copies the contents of a file into the resource-definition file.
#undef   Removes the definition of the specified name.


RESOURCE DEFINITION STATEMENTS

http://msdn.microsoft.com/en-us/library/windows/desktop/aa381043(v=vs.85).aspx

Resources
Resource   Description
ACCELERATORS   Defines menu accelerator keys.
BITMAP   Defines a bitmap by naming it and specifying the name of the file that contains it. (To use a particular bitmap, the application requests it by name.)
CURSOR   Defines a cursor or animated cursor by naming it and specifying the name of the file that contains it. (To use a particular cursor, the application requests it by name.)
DIALOG   Defines a template that an application can use to create dialog boxes.
DIALOGEX   Defines a template that an application can use to create dialog boxes.
FONT   Specifies the name of a file that contains a font.
HTML   Specifies an HTML file.
ICON   Defines an icon or animated icon by naming it and specifying the name of the file that contains it. (To use a particular icon, the application requests it by name.)
MENU   Defines the appearance and function of a menu.
MENUEX   Defines the appearance and function of a menu.
MESSAGETABLE   Defines a message table by naming it and specifying the name of the file that contains it. The file is a binary resource file generated by the message compiler.
POPUP   Defines a menu item that can contain menu items and submenus.
PLUGPLAY   Obsolete.
RCDATA   Defines data resources. Data resources let you include binary data in the executable file.
STRINGTABLE   Defines string resources. String resources are Unicode or ASCII strings that can be loaded from the executable file.
TEXTINCLUDE   A special resource that is interpreted by Visual C++. For more information, see TN035.
TYPELIB   A special resource that is used with the /TLBID and /TLBOUT linker options.
User-Defined   Defines a resource that contains application-specific data.
VERSIONINFO   Defines a version-information resource. Contains information such as the version number, intended operating system, and so on.

Controls
Control   Description
AUTO3STATE   Creates an automatic three-state check box control.
AUTOCHECKBOX   Creates an automatic check box control.
AUTORADIOBUTTON   Creates an automatic radio button control.
CHECKBOX   Creates a check box control.
COMBOBOX   Creates a combo box control.
CONTROL   Creates an application-defined control.
CTEXT   Creates a centered-text control.
DEFPUSHBUTTON   Creates a default pushbutton control.
EDITTEXT   Creates an edit control.
GROUPBOX   Creates a group box control.
ICON   Creates an icon control. This control is an icon displayed in a dialog box.
LISTBOX   Creates a list box control.
LTEXT   Creates a left-aligned text control.
PUSHBOX   Creates a push box control.
PUSHBUTTON   Creates a push button control.
RADIOBUTTON   Creates a radio button control.
RTEXT   Creates a right-aligned control.
SCROLLBAR   Creates a scroll bar control.
STATE3   Creates a three-state check box control.
 
Statements
Statement   Description
CAPTION   Sets the title for a dialog box.
CHARACTERISTICS   Specifies information about a resource that can be used by tool that can read or write resource-definition files.
CLASS   Sets the class of the dialog box.
EXSTYLE   Sets the extended window style of the dialog box.
FONT   Sets the font with which the system will draw text for the dialog box.
LANGUAGE   Sets the language for all resources up to the next LANGUAGE statement or to the end of the file. When the LANGUAGE statement appears before the beginning of the body of an ACCELERATORS, DIALOG, MENU, RCDATA, or STRINGTABLE resource definition, the specified language applies only to that resource.
MENU   Sets the menu for the dialog box.
MENUITEM   Defines a menu item.
STYLE   Sets the window style for the dialog box.
VERSION   Specifies version information for a resource that can be used by tool that can read or write resource-definition files.


RC SOURCE CODE EXAMPLES:
========================

ICON EXAMPLE:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa381018(v=vs.85).aspx

Create a textfile: myresources.rc containing:

#define IDI_ICON 1001
IDI_ICON ICON "OxIcon.ico"



RESOURCE COMPILING TOOLS:
=========================

After compiling your program.

at the command console:

COMPILING WITH GORC:


>>gorc /r myresources.rc

(this produces a 'myresources.res' file)


LINKING WITH LINKRES2EXE:

>>LinkRes2Exe myresources.res myprogram.exe

(this binds the data in myresources.res to myprogram.exe)