Link to home
Start Free TrialLog in
Avatar of ampapa
ampapa

asked on

Wait for process to end

Give the hwnd of a window can someone supply me with the code to wait for it to end processing?

Thanks,
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ampapa
ampapa

ASKER

emoreau, WSH is out as a solution. Thanks.

Michael, this process is already running so the second part of the suggested answer won't work and the first part doesn't seem to. Even though the process stopped process or was hidden, the event never fired.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ampapa

ASKER

A couple of questions.

The 'proc' in "WaitForSingleObject(proc.hProcess, INFINITE)" is a HWND? to the process that was started with the shell application is that correct? So they are getting the HWND using 'SHELL', the process that I am using is already running so do I need to identify the HWND and PID of it and then supply it to the 'WaitForSingleObject' function ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ampapa

ASKER

This process has not been 'shelled' but is currently a running process. So, essentially I want to be able to wait for a process to end given a HWND and or PID.

Thanks,