On Windows you can create a .rc resource file, compile it with "windres" software that comes with lazarus. That will produce a .res file, which you can link into the executable putting this:
{$IFDEF Win32}
{$R myresource.res}
{$ENDIF}
In the main program file (or other unit).
A RC file has statements like this:
101 ICON "iconfile.ico"
You can use windres like this, on the command line: windres -i magnifier.rc -o magnifier.res
There are some Windows API functions you can use to load the resource from the executable into memory.
If you want, you can use the Virtual Magnifying Glass as an example. Download the source code here:
http://sourceforge.net/project/showfiles.php?group_id=60638The source code contains a rc file, a batch script to compile that file, and source code that loads the contents of the resources into memory and uses them. It also contains IFDEFs to load the resources from files on Unixes, because on Linux you usualy don´t link anything into the executable, you keep things on external files.