11-17-2005, 08:14 AM
watchExec_handle = run("long_running_application_name.exe")
...
clo watchExec_handle
I have to say that run returns not window handle, and it cannot be used with clo. To get window handle, use code like this:
Or get it later with win(...).
run returns process handle. It can be used with wait, and with some Windows API functions (dll functions), including TerminateProcess.
Or:
TerminateProcess should be used only to terminate hung apps. It does not allow the app to execute any exit code.
...
clo watchExec_handle
I have to say that run returns not window handle, and it cannot be used with clo. To get window handle, use code like this:
int window_handle
run "notepad.exe" "" "" "" 0x800 "- Notepad" window_handle
5
clo window_handle
Or get it later with win(...).
run returns process handle. It can be used with wait, and with some Windows API functions (dll functions), including TerminateProcess.
int process_handle
process_handle=run("notepad.exe")
5
TerminateProcess process_handle 1
CloseHandle process_handle
Or:
TerminateProcess should be used only to terminate hung apps. It does not allow the app to execute any exit code.