本文整理自网络,侵删。
var SI : TStartupInfo; PI : TProcessInformation; pid:DWORD; begin ZeroMemory(@SI, SizeOf(SI)); //ZeroMemory宏用0来填充一块内存区域 SizeOf//Pascal的一种内存容量度量函数 ZeroMemory(@PI, SizeOf(PI)); SI.cb := SizeOf(SI); if CreateProcess(nil,'d:/CALC.EXE', nil, nil, FALSE, 0 ,nil,nil, SI, PI) then begin Pid := pi.dwProcessId; //获取打开文件的PID ShowMessage(IntToStr(pid));//显示PID值 CloseHandle(PI.hProcess); CloseHandle(PI.hThread); end; end; 相关阅读 >>
Delphi unidac 连接mdb access 数据库
Delphi firemonkey限制tedit只能输入数字的完美方法
Delphi thttpclient 时获取跳转后的 url
更多相关阅读请进入《Delphi》频道 >>