Consultor Eletrônico



Kbase P17553: How to terminate a Progress session from another program aft
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/28/2003
Status: Unverified

GOAL:

How to terminate a Progress session from another program after a given period of time

FACT(s) (Environment):

The following generic steps outline how to have a separate background program automatically terminate a Progress session after a given amount of time:

- Create a program (in whatever language is desired) that accepts a command line parameter which is the PID (Process ID) of the Progress session which should be monitored

- The above program will use Windows API calls to determine if the PID is still active and to terminate it after a given amount of time.

- The Windows API calls to use are OpenProcess, CloseHandle, GetCurrentProcessID and ExitProcess.

- When the Progress session starts, invoke the GetCurrentProcessID API call to obtain the PID of the Progress session then use OS-COMMAND to invoke the monitoring program (see above) and pass the PID to the monitoring program.

The actual writing of this monitoring program is left as an exercise for the reader.