Solvedproblem with OpenProcess()

Posts 1–2 of 2 · Page 1 of 1
problem with OpenProcess()
HWND hwnd = FindWindow(0, (LPCSTR)"World of Warcraft");
if(hwnd == 0){
cout << "Error, can8 find windows."<<endl;
}else{
cout << "founded World of Warcraft."<<endl;

DWORD proc_id;
GetWindowThreadProcessId(hwnd, &proc_id);

cout << proc_id<< endl;

HANDLE hproc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);
if(!hproc){
cout << "Error, can't opeen process " <<GetLastError()<< endl;
}else{
cout << "Process opened" << endl;
}


it is giveing me Error "Error, can't opeen process 5"

help plz.
You need to enable the SeDebugPrivilege, also watch this.
Are you using Visual Studio?
Posts 1–2 of 2 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us