?
Solved

Thread ID

Posted on 2003-03-25
8
Medium Priority
?
193 Views
Last Modified: 2010-04-17
How can i get the ThreadID of a running process, I only know how to get it into the Process_Information struct using CreateProcess, But thats not very helpful if the process is already running.

Thankx
0
Comment
Question by:-TM-
7 Comments
 

Expert Comment

by:TicketToTotalitarianism
ID: 8206632
GetCurrentThreadId() gets the ID of the current thread, so you could make a thread-method for getting the ID.


GetThreadId,GetProcessIdOfThread
is only supported in Windows Server 2003.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getthreadid.asp
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 8208053
Java:

Thread t = Thread.currentThread () ; // gets a reference to the current thread
t.setName ( "myThread" ) ; // sets a name for the current thread
String str = t.getName () ; // gets the name of the current thread

Mayank.
0
 

Expert Comment

by:CleanupPing
ID: 9446806
-TM-:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Expert Comment

by:TicketToTotalitarianism
ID: 9449744
Well, I answered my own question :D

I only forgot about the question :(

here's a MSDN link to GetCurrentThreadId() :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getcurrentthreadid.asp
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 9451900
Recommendation: Accept mayankeagle's comment as answer. It meets the questioner's needs.
0
 

Expert Comment

by:TicketToTotalitarianism
ID: 9464038
mayankeagle, this is a win32 question, not a java question (I'm programming in delphi), sorry.

the name of a thread is not what I need.
I need the reference ID of the thread (that's generated by windows)

but nobody answered how to do THAT...
0
 

Accepted Solution

by:
Chmod earned 0 total points
ID: 9481329
PAQ'd & points NOT refunded

Chmod
Community Support Moderator @Experts Exchange
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question