![]() |
Liste aller Threads einer Application
Wie bekomme ich eine Liste aller Threads heraus die in meiner Application gerade aktiv sind?
|
Re: Liste aller Threads einer Application
Hallo,
du solltest dies unter Zurhilfenahme der ToolHelp32 und den Funktionen Thread32First und Thread32Next hinbekommen. |
Re: Liste aller Threads einer Application
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; |
Re: Liste aller Threads einer Application
Danke, für die schnelle Hilfe :-)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:29 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz