Thanks. I wrote the following code:
DWORD pid = ::GetCurrentProcessId ();
THREADENTRY32 entry;
entry.dwSize = sizeof (THREADENTRY32 );
int count;
HANDLE handle = ::CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD , pid );
BOOL enum_more = Thread32First ( handle, & entry);
count = 0;
while (1)
{
enum_more = Thread32Next ( handle, & entry);
if ( !enum_more )
break;
if ( entry.th32OwnerProcessID == pid )
count ++;
}
Regards,
Ab.
"David Lowndes" <Da****@example.invalid> wrote in message
news:n4********************************@4ax.com...
In native/unmanaged vc2k5, I want to get the thread count of my process.
What apis do I have to use to get the thread count?
Try the Thread32First, Thread32Next APIs.
Dave