I assume that you want to get the window handle from a thread id. To do that, I would:
Pass the thread id to GetProcessIdOfThread() to obtain a process id
Because a process can open multiple windows, you need to return a collection. Iterate every window, getting their process ids. If it matches the id from 1., then add the window handle to the collection
OSDev :)