You are on page 1of 1

Windows

Windows
Windows
Windows
Windows

2000 = GetModuleFileName()
XP x32 = GetProcessImageFileName()
XP x64 = GetProcessImageFileName()
Vista = QueryFullProcessImageName()
7 = QueryFullProcessImageName()

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 ++;
}