Question: How to get a window handle from a process ID 
Author Message
 Question: How to get a window handle from a process ID

NT 4.0 sp3
VC++ 5.0

Hello,

I have an MFC application that starts other applications via CreateProcess.
This will return the Process ID, etc. in a PROCESS_INFORMATION struct.  What
I would like to do is get the main (top level) window handle for this new
process, if possible.

Thanks for any help,

Barry Hurt



Fri, 19 Jan 2001 03:00:00 GMT  
 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.

Tomas Restrepo

http://www.geocities.com/SiliconValley/Heights/3401

Quote:

>NT 4.0 sp3
>VC++ 5.0

>Hello,

>I have an MFC application that starts other applications via CreateProcess.
>This will return the Process ID, etc. in a PROCESS_INFORMATION struct.
What
>I would like to do is get the main (top level) window handle for this new
>process, if possible.

>Thanks for any help,

>Barry Hurt




Sat, 20 Jan 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting process ID from process handle

2. window handle from process id

3. !Help: How to get Window handle from Process ID

4. Getting a window handle using control id

5. Process id from process handle (how to get)?

6. How to obtain Process ID If I have process handle

7. Process ID from Process Handle

8. Process ID from Process Handle

9. getting process ID of the current process

10. Getting window handle for a process

11. Getting the handle of a given process's main window

12. process handles and ids

 

 
Powered by phpBB® Forum Software