Question: How to get a window handle from a process ID
Use EnumWindows() to enumerate all top level windows. Inside your
enumeration procedure, call GetWindowThreadProcessID() to get the window
owner's Process ID, and compare it with the ProcessID you have.
>NT 4.0 sp3
>I have an MFC application that starts other applications via CreateProcess.
>This will return the Process ID, etc. in a PROCESS_INFORMATION struct.
>I would like to do is get the main (top level) window handle for this new
>process, if possible.
>Thanks for any help,