I could not find this info anywhere else, so I will ask you all. I have a few ProcessIDs. I want to compare them to a handle (HWND) I have to see if the handle corresponds to the PID. I know these two things are different. How can I get a HWND from a PID or vice versa? I also have a module handle & exe path & name if any of that helps. I am quite stumped. Looking for guidance....thanks.
Posted on 2001-11-19 15:13:39 by lackluster
I'm sure here there are people that can explain this much better. Anyway, you should use GetWindowThreadProcessId
DWORD GetWindowThreadProcessId(
HWND hWnd, // handle to window
LPDWORD lpdwProcessId // process identifier
);
Parameters
hWnd
Handle to the window.
lpdwProcessId
Pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not.
Return Values
The return value is the identifier of the thread that created the window.
Posted on 2001-11-19 15:27:17 by LuHa
:alright: sweet, thanks.
Posted on 2001-11-19 15:34:21 by lackluster