I'm sure this is a hugely simple question. If I view a program in Spy++ I can see a Thread ID. When running my application, how do I get this (it's own Thread ID, not anothers)
Asked
Active
Viewed 113 times
-1
-
Does this question help? http://stackoverflow.com/questions/1922982/how-can-i-detect-if-a-thread-has-windows-handles – Daniel Kelley Feb 15 '13 at 14:40
-
@DanielKelley Looks handy, but to clarify, I only need the ThreadID of my own application. – Dan Feb 15 '13 at 14:43
-
1This is already answered here I believe; http://stackoverflow.com/questions/1679243/getting-the-thread-id-from-a-thread – DiskJunky Feb 15 '13 at 14:49
1 Answers
1
I think what you want is GetCurrentThreadId():
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683183(v=vs.85).aspx?ppud=4

Aaron
- 9,123
- 5
- 40
- 38