HANDLE PHandle;
PROCESSENTRY32 ProcEntry;
BOOL Result;
Result=false;
PHandle = CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS,0);
ProcEntry.dwSize = sizeof(PROCESSENTRY32);
if (!Process32First(PHandle, &ProcEntry))
{
if (ExtractFileName(ProcEntry.szExeFile) == “process.exe” || ExtractFileName(ProcEntry.szExeFile) == “process.exe”) Result = true;
}
while(Process32Next(PHandle, &ProcEntry))
if (ExtractFileName(ProcEntry.szExeFile) == “process.exe” || ExtractFileName(ProcEntry.szExeFile) == “process.exe”)
{
Result = true;
}
if(Result) // если нашли прячимся.
{
ShowMessage(“прога нашлась”);
}
0 Комментарии。