function TReadMemory.GetProcessInfo: TList;<br>var<br> ProcessInfoList : TList;<br> ProcessInfo : PProcessInfo;<br> hSnapShot : THandle;<br> mProcessEntry32 : TProcessEntry32;<br> bFound : Boolean;<br>begin<br> ProcessInfoList:=TList.Create;<br> ProcessInfoList.Clear;<br> hSnapShot := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);<br> mProcessEntry32.dwSize := Sizeof(mProcessEntry32);<br> bFound := Process32First(hSnapShot, mProcessEntry32);<br> while bFound do<br> begin<br> New(ProcessInfo);<br> ProcessInfo.ProcessExe := mProcessEntry32.szExeFile;<br> ProcessInfo.ProcessId := mProcessEntry32.th32ProcessID;<br> ProcessInfoList.Add(ProcessInfo);<br> bFound := Process32Next(hSnapShot, mProcessEntry32);<br> end;<br> Result := ProcessInfoList; <br>end;