Sign in to follow this  
Followers 0
Shanlar

Script closing another script?

3 posts in this topic

Is it possible to have an autoit script close another autoit script? I have tried WinClose and WinKill with no luck. ProcessClose works, but I don't want to close it that way.

$pid = ProcessExists("window_placement.exe")
WinClose($pid)

Share this post


Link to post
Share on other sites



If I WinClose the interpreter window, then I see no MsgBox with "See Me?". If you comment the WinClose and run it again, then you will see the MsgBox with "See Me?".

AutoitWinSetTitle('I am an invisible window')

WinClose('I am an invisible window')

MsgBox(0, '', 'See Me?')

Exit

Func OnAutoItExit()
    MsgBox(0, '', 'Finished')
EndFunc

Possibly a non process killing method. Further testing may reveal if correct.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

In your first script, set a hotkey (in this case, Alt+Win+ScrollLock) that calls a function containing the Exit keyword:

HotKeySet("!#{SCROLLLOCK}", "Terminate")
Func Terminate()
   Exit
EndFunc
oÝ÷ Øò¢êìyÊ'vÇ+lzwm«a¢ÙÊÚ,"Ú0jwb·¥·©Évê[ÊØ^~*ì¶Ç+ZºÚ"µÍÙ[
    ][ÝÉÌÌÎÈÞÔÐÔÓÐÒßI][ÝÊB

(A little off topic, but has anyone else noticed {SCROLLLOCK} isn't in the Send Keys list in the help file? Just for the record, it works, and it's great if you need a hotkey that is really unlikely to conflict with other apps.)

Edited by sohfeyr

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0