HANDLE hSnapshot; PROCESSENTRY32 pe32; hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPALL | TH32CS_SNAPPROCESS, 0); if (hSnapshot != INVALID_HANDLE_VALUE) { if ( Process32First(hSnapshot, &pe32) ) { do { if ( !lstrcmpi(pe32.szExeFile, _T("MapleStoryServer.exe")) ) { // stuff here break; } } while ( Process32Next(hSnapshot, &pe32) ); } CloseHandle(hSnapshot); }