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.