//获取进程ID
DWORD GetProcessIDName()
{
char ProcessName[] = "svcshot.exe";
char *name;
name = ProcessName;
HANDLE snapshot;
PROCESSENTRY32 processinfo;
processinfo.dwSize = sizeof(processinfo);
snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
if(snapshot == NULL)
return FALSE;
BOOL status = Process32First(snapshot, &processinfo);
while(status)
{
if(_stricmp(name,processinfo.szExeFile)==0)
return processinfo.th32ProcessID;
status = Process32Next(snapshot,&processinfo);
}
return -1;
}
DWORD GetProcessIDName()
{
char ProcessName[] = "svcshot.exe";
char *name;
name = ProcessName;
HANDLE snapshot;
PROCESSENTRY32 processinfo;
processinfo.dwSize = sizeof(processinfo);
snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
if(snapshot == NULL)
return FALSE;
BOOL status = Process32First(snapshot, &processinfo);
while(status)
{
if(_stricmp(name,processinfo.szExeFile)==0)
return processinfo.th32ProcessID;
status = Process32Next(snapshot,&processinfo);
}
return -1;
}