Thread
-
Hi everyone How can I find threads belong to a specific process? Is there any api for it?
You can use Tool Help API (i.e. Thread32First and Thread32Next). See a sample here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686852(v=vs.85).aspx[^]
-
You can use Tool Help API (i.e. Thread32First and Thread32Next). See a sample here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686852(v=vs.85).aspx[^]
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
-
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
-
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
-
Ok, I ran that exact code, only changing:
if (te32.th32OwnerProcessID == 4948) // process id of calc.exe
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 = 0Given 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
-
Ok, I ran that exact code, only changing:
if (te32.th32OwnerProcessID == 4948) // process id of calc.exe
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 = 0Given 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