Function GetProcessList(Ts_Exe,Ts_EMS,Ts_PID:Tstrings):boolean;<br>var Pn: TProcesseNtry32; sHandle: THandle;<br> Found: Boolean;<br>begin<br> Ts_Exe.Clear;Ts_EMS.Clear;<br> Ts_PID.Clear;<br> sHandle := CreateToolHelp32SnapShot(TH32CS_SNAPALL, 0);<br> Found := Process32First(sHandle, Pn);<br> While Found do<br> Ts_Exe.Add(ExtractFileName(Pn.szExeFile));<br> Ts_EMS.Add(ExtractFilePath(Pn.szExeFile));<br> TS_PID.Add(IntToStr(Pn.th32ProcessID));<br> Found := Process32Next(sHandle, Pn);<br> end;<br> Result:= Found;<br>end; <br><br><br>来自:wdy801229, 时间:2004-3-19 10:46:20, ID:2510857<br>to jfyes :能否给点注释,吾乃菜鸟<br>多谢! <br><br><br>来自:jfyes, 时间:2004-3-19 10:58:52, ID:2510890 | 编辑<br>在uses 加入TlHelp32单元,“Pn”是TProcesseNtry32 record记录类型; <br>