你用CreateProcess创建进程吧,这个函数会返回一个被创建进程的句柄的,用TerminateProcess可以停止此进程。
解决方案 »
- Operator not applicable to this operand type 咋办??
- AdvStringGrid数据如何实现循环滚动?就像火车站大厅那种!
- 高手请,有点麻烦?
- 第一次花100分来提问,求一个智能的copy文件的解决方案.
- 初学delphi请教,在paradox表中,type中的Alpha类型?各位帮帮忙:)
- 终于由新人变为2个三角了~~~散分~~~
- 如何显示show hints
- 提问:如何取得SQL Server数据库上的某一个表的数据,存放到本地Access库中的某一表中。
- 金山词霸的繁体如何实现?
- FastReport控件打印图片问题
- 请问有什么书上讲了关于D5中嵌套汇编???
- 好消息,今天在书店看到有MASTER DELPHI 6的中文版了!!
hProcess:THandle;
szCommandLine:string=' -n ';
sui:TStartupInfo;
pi:TProcessInformation;
begin
//Create the Process
sui.cb:=sizeof(TStartupInfo);
sui.lpReserved:=nil;
sui.lpDesktop:=nil;
sui.lpTitle:=nil;
sui.hStdOutput:=hWritePipe;//这个你可以不设
sui.hStdError:=hWritePipe;//这个你可以不设
sui.dwFlags:=STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW; CreateProcess('c:\winnt\windump.exe', PChar(szCommandLine), nil, nil, True, 0, nil, nil, sui, pi);
hProcess:=pi.hProcess;
//Wait
Sleep(SleepTime);
//Terminate the Process
TerminateProcess(hProcess,0);
end;