Difference between revisions of "MSEide MSEgui Howto"

From Lazarus wiki
Jump to navigationJump to search
Line 52: Line 52:
 
3) use the compiled resources in your application :
 
3) use the compiled resources in your application :
  
<pre>
+
<delphi>
 
program super_puper;
 
program super_puper;
  
Line 83: Line 83:
 
  application.run;
 
  application.run;
 
end.
 
end.
</pre>
+
</delphi>
  
 
That's all at the moment.
 
That's all at the moment.

Revision as of 18:53, 8 January 2008

Win32 Application Icon and Properties

1) Prepare the resource source files in the directory of your program:

File "version_data.rc":

1 VERSIONINFO
FILEVERSION 4,0,3,17
PRODUCTVERSION 3,0,0,0
FILEFLAGSMASK 0
FILEOS 0x40000
FILETYPE 1
{
 BLOCK ”StringFileInfo”
 {
  BLOCK ”040904E4”
  {
  VALUE ”CompanyName”,”JSC TashkentP”
  VALUE ”FileDescription”,”The main program file”
  VALUE ”FileVersion”,”0.9a”
  VALUE ”InternalName”,”ARM Podpiska”
  VALUE ”LegalCopyright”,”JSC TashkentP’s property”
  VALUE ”OriginalFilename”,”podpiska.pas”
  VALUE ”ProductName”,”The program for ARM Podpiska”
  VALUE ”ProductVersion”,”0.9a”
  }
 }
}

File ”icon_data.rc”:

AppIcon ICON ”app_icon.ico”

where ”app_icon.ico” is 128x128 24bit ICO image. You may use any size at your favour ( usually depends on preferrable destop resilution/size ) commonly greater or equal to 24x24 pixels.

My favorite editor to prepare such ( and any kind of image ) files is ”Embellish”.


2) From within Win-32 command shell, complile the prepared files with the supplied FPC resource compiler :

  1. windres -O res -i version_data.rc -o version_data.res
  2. windres -O res -i icon_data.rc -o icon_data.res


3) use the compiled resources in your application :

<delphi> program super_puper;

{$ifdef FPC}{$mode objfpc}{$h+}{$INTERFACES CORBA}{$endif} {$ifdef FPC}

{$ifdef mswindows}
 {$apptype console}
{$endif}

{$endif} uses

{$ifdef FPC}{$ifdef linux}cthreads,{$endif}{$endif}msegui,mseforms,
main,dmmain,dmprint, dmacnt1, dmf18,dmrefs,
connsetupform,mseconsts,mseconsts_ru,mseconsts_uzcyr;

// importing the compiled resources

{$ifdef mswindows}

{$R version_data.res}
{$R icon_data.res}

{$endif}

begin

setlangconsts('ru');
application.createdatamodule(tdmmainmo,dmmainmo);
application.createdatamodule(tdmprintmo, dmprintmo);
application.createdatamodule(tdmacnt1mo, dmacnt1mo);
application.createdatamodule(tdmf18mo, dmf18mo);
application.createdatamodule(tdmrefsmo, dmrefsmo);
application.createform(tmainfo,mainfo);
application.run;

end. </delphi>

That's all at the moment.