C / C++ / MFC
|
|
 |

|
Hi everyone
How can I find threads belong to a specific process?
Is there any api for it?
|
|
|
|
|

|
I have checked your link but I dont know why its result is different with Task manager
Task manager shows 3 threads for calc.exe but this code generate these info
Thread ID = 0x00016E0
base priority =8
delta priority =0
Thread ID= 0x0000558
base priority =8
delta priority =0
Thread ID= 0x0000115C
base priority =15
delta priority =0
could you help me
|
|
|
|

|
messages wrote: Task manager shows 3 threads for calc.exe... And your code's output shows the identifier of three threads. What were you expecting?
messages wrote: ...but this code generate these info... The code uses GetCurrentProcessId(). How did you go about getting the process identifier for calc.exe?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 11 Dec '12 - 10:52.
|
|
|
|

|
I used of Task manager for get PID
|
|
|
|

|
Ok, I ran that exact code, only changing:
if (te32.th32OwnerProcessID == 4948)
and it produced:
THREAD ID = 0x00000CB8
base priority = 8
delta priority = 0
THREAD ID = 0x00000B18
base priority = 8
delta priority = 0
THREAD ID = 0x000014B0
base priority = 15
delta priority = 0
Given calc's three threads, that's what I would expect.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 11 Dec '12 - 13:02.
|
|
|
|

|
Got it rise and shine sleepyhead it has 3 "THREAD ID " so its 3 threads for calc.exe,is it correct?
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin