La Web del Programador: Comunidad de Programadores
 
    Pregunta:  20312 - MANEJADOR THREAD
Autor:  Andrés Jimeno
¿ COMO LE HAGO PARA CONOCER EL MANEJADOR DE UN THREAD SI NO MAS TENGO SU ID ?. SI EL THREAD LO CREO YO SI QUE ME RETORNA EL MANEJADOR, PERO SI NO, NO HAY MANERA DE SABERLO. GRACIAS

  Respuesta:  Juan Mellado
En el Microsoft® Win32® Programmer's Reference literalmente dice lo siguiente:

"The Win32 API does not provide a way to get the thread handle from the thread identifier. If the handles were made available this way, the owning process could fail because another process unexpectedly performed an operation on one of its threads, such as suspending it, resuming it, adjusting its priority, or terminating it. Instead, you must request the handle from the thread creator or the thread itself. "

Así que mala suerte, pero ... siempre hay alternativas :-).

Consulta en la web de Microsoft el artículo Win32 del número de Junio de 1998 de MSJ (Microsoft System Journal). Te puede servir como punto de partida para hacer lo que quieres, aunque aviso: "es complicado".

Espero haberte ayudado.
Saludos, Juan