oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Sep 01, 2007 4:35 am Post subject: finding the handle to a process(C++)? |
|
|
I want to find the handle to a process so I can use ReadProcessMemory() on it. I'm pretty sure I can use OpenProcess() and FindWindow() and GetWindowThreadProcessId(). I just want to know if this is the right way to do it.
| Code: |
HWND hWnd;
DWORD pid;
HANDLE hProc;
hWnd = FindWindow(NULL,"Name of Window");
GetWindowThreadProcessId(hWnd,&pid);
hProc = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_READ,0,pid);
//start readprocessmemory here....
|
If this isn't the right way cna someone edit the code and post it?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|