bool isRunning (LPCSTR processname) { HANDLE Snapshot; Snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if(Snapshot != INVALID_HANDLE_VALUE) { PROCESSENTRY32 ProcessEntry; BOOL Succeed; ProcessEntry.dwSize = sizeof(PROCESSENTRY32); Succeed = Process32First(Snapshot, &ProcessEntry); while(Succeed) { if(lstrcmp(ProcessEntry.szExeFile,processname) == 0) { return true; } Succeed = Process32Next(Snapshot, &ProcessEntry); } CloseHandle(Snapshot); } }
EnumWindows
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)