Jump to content

on exit... delete this folder


Recommended Posts

i have this:

all i need it to do is have it delete this directory upon exit... it works when i click the done button but not by closing the window by other means... :)

Func Keep_Open()
    Do
        $msg = GUIGetMsg()
        ;This checks the state of the Checkbox if it is checked or 1 then it will set the variable to that.
        $VarStatus1 = GUICtrlRead($Var1_CHKBOX)
        $VarStatus2 = GUICtrlRead($Var2_CHKBOX)
        $VarStatus3 = GUICtrlRead($Var3_CHKBOX)
        $VarStatus4 = GUICtrlRead($Var4_CHKBOX)
        
    Until $msg = $RUN Or $msg = $EXIT Or $msg = $GUI_EVENT_CLOSE
    
    If $msg = $EXIT Then DirRemove("c:\ntst-tmp", 1) 
    Exit
    If $msg = $GUI_EVENT_CLOSE Then DirRemove("c:\ntst-tmp", 1) Exit
    ;If the status is 1 for the variable checkboxes when run is hit, it will execute those lines below which call the functions
    If $VarStatus1 = 1 Then Call("ITEM_1")
    If $VarStatus2 = 1 Then Call("ITEM_2")
    If $VarStatus3 = 1 Then Call("ITEM_3")
    If $VarStatus4 = 1 Then Call("ITEM_4")
    Call("Keep_Open")
EndFunc   ;==>Keep_Open
Link to comment
Share on other sites

i have this:

all i need it to do is have it delete this directory upon exit... it works when i click the done button but not by closing the window by other means... :)

Func Keep_Open()
    Do
        $msg = GUIGetMsg()
        ;This checks the state of the Checkbox if it is checked or 1 then it will set the variable to that.
        $VarStatus1 = GUICtrlRead($Var1_CHKBOX)
        $VarStatus2 = GUICtrlRead($Var2_CHKBOX)
        $VarStatus3 = GUICtrlRead($Var3_CHKBOX)
        $VarStatus4 = GUICtrlRead($Var4_CHKBOX)
        
    Until $msg = $RUN Or $msg = $EXIT Or $msg = $GUI_EVENT_CLOSE
    
    If $msg = $EXIT Then DirRemove("c:\ntst-tmp", 1) 
    Exit
    If $msg = $GUI_EVENT_CLOSE Then DirRemove("c:\ntst-tmp", 1) Exit
    ;If the status is 1 for the variable checkboxes when run is hit, it will execute those lines below which call the functions
    If $VarStatus1 = 1 Then Call("ITEM_1")
    If $VarStatus2 = 1 Then Call("ITEM_2")
    If $VarStatus3 = 1 Then Call("ITEM_3")
    If $VarStatus4 = 1 Then Call("ITEM_4")
    Call("Keep_Open")
EndFunc   ;==>Keep_Open
EndFuncAutoIt is the shiznit. I love it.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...