2019-07-17 01:00:49 (edited by dash 2019-07-17 01:03:24)

Is it possible to perform the action only after closing the application opened by exec? If so, how?
In bgt if i remember i can do it after set the first parameter in bool run to true.

Mao!
--
TD programs website available under new address.
https://tdprograms.ovh/

2019-07-17 05:16:04

#uselib "kernel32"
#func global CreateProcessA "CreateProcessA" sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr
#func global CloseHandle "CloseHandle" sptr
#func global WaitForSingleObject "WaitForSingleObject" sptr,sptr

#module mod_execwait
#deffunc exec_wait str _path, local _startupinfo, local _processinfo
sdim _startupinfo,100
dim _processinfo,4
wpoke _startupinfo,0,68
CreateProcessA 0,_path,0,0,0,0,0,0,varptr(_startupinfo),varptr(_processinfo)
if stat=0:return 0
CloseHandle _processinfo.1
WaitForSingleObject _processinfo.0,$FFFFFFFF
CloseHandle _processinfo.0
return 1
#global

I don't speak as good as I write, and I don't listen as good as I speak.