|
I need some tip on how to crate program that will check if a running process is still running every few seconds or. all the time, like you can see it in windows task manager...
I know how to run a program and have control of it when I start the program at the same time. But it is a problem when I need to check process witch is already running, before I start checking it .
I can paste code when I start the process and controll it. But it is question how to controll already running process . Actually I'm gona paste my example anyway.
Example :
lPid = Shell("c:\working\wrk.exe", vbNormalFocus) If lPid <> 0 Then lHnd = OpenProcess(SYNCHRONIZE, 0, lPid) 'Get a handle to the shelled process. If lHnd <> 0 Then 'If successful, wait for the lRet = WaitForSingleObject(lHnd, INFINITE) ' application to end. CloseHandle (lHnd) 'Close the handle. End If
. . .
Please help. Thank you .
|