Inny typ porozumiewania

0

Taka aplikacja bez socketów i innych.

Mam project1.exe i project2.exe
uruchamiam te 2 programy i chicałbym żeby po naciśnięciu button'a w jednym programie drugi np. pokazał komunikat 'Hit the shi'taaajasssneee)

====i drugi post================ :)
Przez jaki komponent (w Delphi Enterprise ale standardowy [komponent])
mozna przesylac informacje tekstowe???????

0

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

0

THX pq!!!!!!!!!!!!!

1 użytkowników online, w tym zalogowanych: 0, gości: 1