freak wrote:It returns the value of the open thread handle. All functions that return the OS handle end with ..ID() (GadgetID, WindowID, etc).
A thread handle is unique in the system for as long as the thread runs iirc.
No, a thread handle doesn't have to be unique, but that's not the point. I read the description the other way, so that the thread handle
uniquely identified a thread, which means that there is only one thread handle per thread. That's wrong. You can have 1000+ handles for each thread, the number that identifies the thread is the thread id, of which there is exactly one per running thread.
Just because windows has the concept of a "thread id" as well does not neccesarily mean a function
that is named that way will return that. I know that might lead to confusion in this case
but it better fits with how its handled in the other libraries.
It really should be written in the docs if the function called ThreadID() doesn't return the thread id. Also, the description fits only for the thread id and not for the handle, in my opinion.
Besides that, the thread handle is usually more useful when calling API functions than the thread id is.
Well, I need the ID.