我认为最好还是用CreateProcess,<br>因为CreateProcess提供了更多的对进程控制<br><br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> Button2: TButton;<br> procedure Button1Click(Sender: TObject);<br> procedure FormCreate(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>st:TStartUpInfo;<br>pp:TProcessInformation;<br>ppp:Thandle;<br>begin<br>FillChar(st,sizeof(st),#0);<br>with st do<br>begin<br> cb:=sizeof(st);<br> dwFlags:=StartF_UsesTDHandles or STARTF_USESHOWWINDOW;<br> lptitle:=nil;<br> wShowWindow:=SW_Show;<br>end;<br>CreateProcess(PChar('c:/program files/microsoft office/office/winword.exe'),<br> nil,nil,nil,true,DETACHED_PROCESS,nil,nil,st,pp);<br>//关闭进程<br>{ ppp:=OpenProcess(PROCESS_ALL_ACCESS, FALSE,pp.dwProcessId );<br> TerminateProcess(ppp,0);}<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br>//setwindowlong(handle , GWL_STYLE, getwindowlong(handle, GWL_STYLE) and (not WS_CAPTION or WS_BORDER) or WS_Popup);<br>end;<br><br>end.