CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Posts
    19

    How to get ThreadHandle from ThreadId?

    If I got the threadId of a thread running in the system, how can I retrieve its handle. Thread is not created by me, it belongs to some other application

    [email protected]
    B'lore,
    India.


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How to get ThreadHandle from ThreadId?

    the OpenThread API returns a handle for a given ID.


  3. #3
    Join Date
    May 1999
    Posts
    19

    Re: How to get ThreadHandle from ThreadId?

    Hello Lothar,
    I think it was a guess work. OpenProcess is there to return handle of the process id. But there is no such corresponding APIs like OpenThread(). If it is an undocumented one please tell me where can I find it

    [email protected]
    B'lore,
    India.


  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: How to get ThreadHandle from ThreadId?

    "guess work"? I take it as a joke!
    OpenThread is documented in the Platform SDK. Requires Windows2000, though. Forgot to mention that.


  5. #5
    Join Date
    May 1999
    Posts
    19

    Re: How to get ThreadHandle from ThreadId?

    Sorry Lothar,
    Whats the solution for NT4.0. I found an undocumented function NtOpenThread() in NTDLL.Dll. I tried with the parameters like OpenProcess(), but returning error 0xC0000005. Do you know what is this error?

    Regards,
    [email protected]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured