unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;<br>const<br> SX_MYMESSAGE=WM_USER+100;<br>type<br> TSendMsg = class(TForm)<br> procedure FormCreate(Sender: TObject);<br> private<br>{ Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> SendMsg: TSendMsg;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TSendMsg.FormCreate(Sender: TObject);<br>var Myhandle:HWND;<br>begin<br> Myhandle:= FindWindow(nil, 'GetMsg');<br> if MyHandle <> 0 then<br> SendMessage( Myhandle,SX_MYMESSAGE,0,0) <br>end;<br>end.<br><br>unit Unit2;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;<br>const<br> SX_MYMESSAGE=WM_USER+100;<br>type<br> TGetMsg = class(TForm)<br> private<br>procedure get_message(var Message:TMessage);Message SX_MYMESSAGE;<br> { Private declarations }<br> public<br><br> { Public declarations }<br> end;<br><br>var<br> GetMsg: TGetMsg;<br><br>implementation<br><br>{$R *.DFM}<br>procedure TGetMsg.get_message(var Message: TMessage);<br>begin<br> MessageDlg('she turned me into a newt!',mtInformation,[mbOk],0);<br>end;<br>end.<br>