Mega Code Archive

 
Categories / Delphi / API
 

How to dynamically net send a messages to a remote pc

{this is useful to if your running a application on a remote PC and you need the app to send you information on its status.} type TForm1 = class(TForm) btnSend: TButton; //button to send the message edtPC_name: TEdit;//edit that contains the remote PC name edtMessage: TEdit;//edit that contains the message to send procedure btnSendClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.btnSendClick(Sender: TObject); begin // sends message winexec(pchar('Net send '+edtPC_name.text+' '+edtMessage.text),0) end;