AutoIt v3 script

Discussion in 'Application Software' started by NICK@NUMBER11, Mar 27, 2012.

  1. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,503
    720
    60
    #1 NICK@NUMBER11, Mar 27, 2012
    Last edited by a moderator: Apr 20, 2017
    Hi all,

    I am looking for a way to change the below script so that I am not prompted with the windows below when clicking on the "X" of the menu that i have created with the AutoIt v3 program.


    Here is the code

    Code:
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    
    ;==========================================================================
    ;==========================================================================
    ;==========================================================================
    ;The settings file must be names SETTINGS.INI
    ;[Settings]
    ;NbButton = 2
    ;Title=Menu Title
    ;
    ;[1]
    ;Text=Caption1
    ;Command=X:\Toto\Toto.exe
    ;WorkDit=X:\Toto
    ;Params=/qb
    ;
    ;[2]
    ;Text=Caption2
    ;Command=X:\Toto1\Toto1.exe
    ;WorkDit=X:\Toto1
    ;Params=/qb /qn
    ;
    ;==========================================================================
    ;==========================================================================
    ;==========================================================================
    
    
    ;==========================================================================
    ;Checking if SETTINGS.INI exist
    ;==========================================================================
    If NOT FileExists("settings.ini") Then
           MsgBox(4096,"Missing File", "SETTINGS.INI can not be found!")
       Exit
    EndIf
    
    ;==========================================================================
    ;Creating an array with all buttons from INI file.
    ;==========================================================================
    $NbButton = IniRead("settings.ini","settings","nbbutton",-1)
    If $NbButton = -1 Then Exit
    
    $Title = IniRead("settings.ini","settings","title","Main Menu")
    
    $Main = GUICreate($Title,220,($NbButton*60)+10)
    Dim $Menu[$NbButton][5]
    For $i = 0 to $NbButton-1
    $Menu[$i][0] = IniRead("settings.ini",$i+1,"text","")
    $Menu[$i][1] = IniRead("settings.ini",$i+1,"command","")
    $Menu[$i][2] = IniRead("settings.ini",$i+1,"params","")
    $Menu[$i][3] = IniRead("settings.ini",$i+1,"WorkDir","")
    $Menu[$i][4] = GUICtrlCreateButton($Menu[$i][0],10,($i*60)+10,200,50)
    Next
    
    ;==========================================================================
    ;Display the GUI and listening to command.
    ;==========================================================================
    GUISetState(@SW_SHOW)
    While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then
    If MsgBox(4+32,"Quitter","Voulez-vous vraiment quitter?") = 6 Then ExitLoop
    EndIF
    
    For $i = 0 to $NbButton-1
    If $msg = $Menu[$i][4] Then
    ShellExecute($Menu[$i][1],$Menu[$i][2],$Menu[$i][3])
    EndIf
    Next
    WEnd
    
    and here is what i am trying to get ride of....

    Capture.jpg


    Ok sorted it now, just need to end this bit of code...
    If $msg = $GUI_EVENT_CLOSE ThenExitLoop
    :eek:
     
  2. alikewan

    alikewan MDL Novice

    Nov 17, 2011
    23
    6
    0
    Thank frind