Process ID from name
ALLRIGHT!!! Here''s what I''m doing:
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
PROCESSENTRY32 proc ;
proc.dwSize = sizeof(proc);
long f = Process32First(hSnap,&proc);
char sname[MAX_PATH]={0};
while(f)
{
strcpy(sname,proc.szExeFile);
cout << sname << endl << flush;
f = Process32Next(hSnap, &proc);
}
As a test. This works!! WOOHOO!! Now all I have to do is get the ID! Thanks!
Kings of Chaos
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
PROCESSENTRY32 proc ;
proc.dwSize = sizeof(proc);
long f = Process32First(hSnap,&proc);
char sname[MAX_PATH]={0};
while(f)
{
strcpy(sname,proc.szExeFile);
cout << sname << endl << flush;
f = Process32Next(hSnap, &proc);
}
As a test. This works!! WOOHOO!! Now all I have to do is get the ID! Thanks!
Kings of Chaos
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement