Przeslij komunikat z Project1 do Poject2
W unicie Project1
const
WM_BLE=WM_USER+55; //55 - arbitralna wartosc
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
PostMessage(FindWindow('TForm1','Okno Projektu 2'),WM_BLE,0,0);
end;
end.
Form Projectu2 musi byc klasy TForm1 i miec Caption 'Okno Projektu 2'
W unicie Project 2
const
WM_BLE=WM_USER+55;
type
TForm1 = class(TForm)
Label1: TLabel;
private
{ Private declarations }
procedure GetMessage(var x); message WM_BLE;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure Tform1.GetMessage(var x);
begin
Label1.Caption:='Hit the shi';
end;
end.--Pawel
Delphi6