最简单的方法,广播自定义消息。<br>const<br> myMessage=WM_User+$345;<br>...<br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> RegisterWindowMessage(myMessage);<br>end;<br>...<br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> SendMessage(HWND_BROADCAS,myMessage,0,0);<br>end;<br><br>接收程序中:<br>const<br> myMessage=WM_User+$345;<br>...<br>type<br> TForm1 = class(Form)<br> ...<br> private<br> procedure OnMyMessage(var Msg: TMessage); message myMessage;<br>...<br>procedure TForm1.OnMyMessage(var Msg: TMessage);<br>begin<br> ShowMessage('Message Received!');<br>end;