(Gast)
n/a Beiträge
|
Re: Liste aller Threads einer Application
26. Apr 2005, 12:12
Delphi-Quellcode:
uses
TlHelp32;
var
Snapshot: THandle;
Thread32: TThreadEntry32;
begin
Snapshot := CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, GetCurrentProcessId());
if (Snapshot <> 0) and (Snapshot <> INVALID_HANDLE_VALUE) then
try
ZeroMemory(&Thread32, SizeOf(TThreadEntry32));
Thread32.dwSize := SizeOf(TThreadEntry32);
if Thread32First(Snapshot, Thread32) then
repeat
//...
until not Thread32Next(Snapshot, Thread32);
finally
CloseHandle(Snapshot);
end;
end;
|
|
Zitat
|