给你个例子
functiondo
Something(const APath,ACommandLine: PChar): Byte;stdcall;
var
StartUpInfo: TStartUpInfo;
ProcessInformation: TProcessInformation;
CreateProcResult: Boolean;
begin
ZeroMemory(@StartUpInfo,0);
FillChar(StartUpInfo,sizeof(StartUpInfo),#0);
with StartUpInfodo
begin
cb := sizeof(StartUpInfo);
dwFlags := StartF_UsesTDHandles or STARTF_USESHOWWINDOW;
lptitle := nil;
wShowWindow:=SW_Show;
end;
CreateProcResult := CreateProcess(APath,ACommandLine,nil,nil,true,
DETACHED_PROCESS,nil,nil,StartUpInfo,ProcessInformation);