Przepraszam że jeden pod drugim ale zamieszczę sam kod na stronie jak kogoś interesuje caly projekt jest do pobrania z linku wyżej.
Project1.dpr
program Project1;
{$DEFINE PROG1}
uses
Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Project2.dpr
program Project2;
{$DEFINE PROG2}
uses
Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Unit1.pas
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
{$IFDEF PROG1}
Form1.Caption:='Program 1';
{$ENDIF}
{$IFDEF PROG2}
Form1.Caption:='Program 2';
{$ENDIF}
end;
end.
Unit1.dfm
object Form1: TForm1
Left = 0
Top = 0
ClientHeight = 213
ClientWidth = 339
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
end