int main(void) { bool retVal = false; ProcessMemory* pProcMem = NULL; HANDLE hThread = NULL; /* DialogBox(NULL, MAKEINTRESOURCE(IDD_DIALOG1), NULL, About); */ pProcMem = new ProcessMemory(); retVal = pProcMem->loadProcessByWindowName("Might and Magic® VI"); if (retVal) { std::cout << "Might and Magic VI Found !" <<std::endl << "==========================" <<std::endl <<std::endl << "F2 \t Give 2000 Gold" <<std::endl << "F3 \t Give 10 Food" <<std::endl <<std::endl << "F5 \t Set each heroes life points to 4000" <<std::endl; hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)thread_fct, pProcMem, 0, 0); if (hThread) WaitForSingleObject(hThread, -1); } else std::cout << "Game not Found..." <<std::endl; delete pProcMem; system("PAUSE"); return (EXIT_SUCCESS); }