L
loxuan
Unregistered / Unconfirmed
GUEST, unregistred user!
Procedure EmThreadList(ProcessIDword);<br>var<br> mSnapshot:THandle;<br> mTrEntry:TThreadEntry32;<br>begin<br> mSnapshot:=CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD,0);<br> mTrEntry.dwSize:=Sizeof(TThreadEntry32);<br> Thread32First(mSnapshot,mTrEntry);<br> Repeat<br> if mTrEntry.th32OwnerProcessID=ProcessID then<br> begin<br> Form1.Memo1.Lines.Add(IntToStr(mTrEntry.th32ThreadID));<br> end;<br> Until Not Thread32Next(mSnapshot,mTrEntry);<br> CloseHandle(mSnapshot);<br>end;