TThread.NameThreadForDebugging is great for telling threads apart, but not all of my threads are TThread descendants. I have some that are created by an external library that's not even written in Delphi. Is there any way to name them if I can find a way to get their thread handles?
See this MSDN article: How to: Set a Thread Name in Native Code
This works for Visual Studio. I don't know whether the Delphi debugger will pick up the name.
Note that you need the thread ID rather than the thread handle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With