numdig Posted July 28, 2011 Share Posted July 28, 2011 (edited) Here are two samples for launching and keeping an eye on other applications.It is handy when it comes to dealing with webservers: we can keep the little AutoIT icon in the taskbar and terminate the webserver when needed.The important bit is:Global $SUPERVISED_PID___GLOBAL = 0 OnAutoItExitRegister("OnAutoItExitV01")And the function:Func OnAutoItExitV01() ; was there an error? If @exitCode Then Return ; close by clicking on exit of the systray? If @exitMethod = 2 Then ; close the grand-children as well $list = _ProcessGetChildren($SUPERVISED_PID___GLOBAL) If IsArray($list) Then For $i = 1 To $list[0][0] If ProcessExists($list[$i][0]) Then ProcessClose($list[$i][0]) ProcessWaitClose($list[$i][0]) EndIf Next EndIf ; close the main process If ProcessExists($SUPERVISED_PID___GLOBAL) Then ProcessClose($SUPERVISED_PID___GLOBAL) EndIf EndFunc ;==>OnAutoItExitV01Credits: SmOke_N for the _ProcessGetChildren function( http://www.autoitscript.com/forum/index.php?showtopic=78445 )LaunchTrac.au3LaunchApacheOnly.au3_ProcessGetChildren.au3LaunchZendApacheOnly.au3 Edited May 4, 2012 by Chess Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now