program Pvdde; uses Forms,shellapi,Windows,dialogs,dde in 'dde.pas' {Form1}; {$R *.RES} begin if GlobalFindAtom(PChar('PDDE_IS_RUNNING')) = 0 then //避免二次启动 begin K:=GlobalAddAtom(PChar('PDDE_IS_RUNNING')); Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end else begin //传递二次启动时的参数到第一个实例 H := FindWindow(PChar('TForm1'), PChar('资料保密严禁外传')); if ParamCount > 0 then begin L := GlobalAddAtom(PChar(ParamStr(1))); if H<>0 then SendMessage(H, WM_MYMESSAGE, 0, L); { 传递原子句柄 } "DELPHI实现程序间的数据传递"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Language/Delphi/2010-01-26/12431.html
关于《DELPHI实现程序间的数据传递》文章的评论