//by EvilFourZero(don't forgot to give credit), KOrUPt. HANDLE GetProcessHandle(LPSTR szExeName) { PROCESSENTRY32 Pc = { sizeof(PROCESSENTRY32) }; hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0); if(lpfProcess32First(hSnapshot, &Pc)) { do{ if(!strcmp(Pc.szExeFile, szExeName)) { if(!hProcess) { return OpenProcess(PROCESS_ALL_ACCESS, TRUE, Pc.th32ProcessID); } } Sleep(100); }while(lpfProcess32Next(hSnapshot, &Pc)); } return NULL; }