Sign in to follow this  
Followers 0
zvvyt

Dynamically created GUIs with simultaneous minimize/restore but only one "shown" window

8 posts in this topic

Hello ya'll!

My problem is split in two, so I'll start with the first one:

What I'm having is my script with dynamically created GUIs with similar / identical names. I would like to have that undepending on how many windows I have open to only have one "window" down at the taskbar.

I guess all I need is the correct GUI style, but I can't find which one I need.

Which brings me to problem part 2 (which I also find to be the easy part):

Windows will open and close on random, so there's no set order in which they'll get closed. But I still need one "window" at the taskbar to work with as long as there's at least one window open.

In the action of one of these windows getting minimized/restored all of the windows will act simultaneously.

This will be solved with something similar: 

case $GUI_EVENT_MINIMIZE
         for $1 = 1 to Ubound($ActiveWindows) step +1
                WinSetState($ActiveWindows[$1], @SW_MINIMIZE)
        Next

And vice versa for restore.

So .. Mainly prob #1 that I need some help with, and a thought about the "always one window at taskbar"-issue.

Just point me in the right direction and I'll hopefully solve it myself ^__^'

Thanks, and have a great weekend!

zvvyt

Share this post


Link to post
Share on other sites



have a look:

Opt("TrayIconHide", 1) ; this will hide all
; or
TraySetState(2) ; will hide the tray icon

I'm not sure if this will leave you 1 tray icon for at least 1 window; I'm sure a guru will chime in ;)

To minimize all you can do the following:

WinMinimizeAll() ; this will minimize all windows
;or
Local $ShellObj = ObjCreate("Shell.Application")
$ShellObj.ToggleDesktop() ; will minimize all currently open windows -- if called again, it will bring up all windows minimized by ToggleDesktop()

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

zvvyt,

To hide the button on the taskbar you need to set another GUI as the "parent" in the GUICreate call. So it sounds like you could do with a "master" GUI with all the others as children. :)

Is that enough to get you going? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

 

have a look:

Opt("TrayIconHide", 1) ; this will hide all
; or
TraySetState(2) ; will hide the tray icon

I'm not sure if this will leave you 1 tray icon for at least 1 window; I'm sure a guru will chime in ;)

I'm sorry if I were unclear, but it's not in the tray where I only want one icon, but on the taskbar where only the open windows are.

To minimize all you can do the following:

WinMinimizeAll() ; this will minimize all windows
;or
Local $ShellObj = ObjCreate("Shell.Application")
$ShellObj.ToggleDesktop() ; will minimize all currently open windows -- if called again, it will bring up all windows minimized by ToggleDesktop()

I only want to minimize the windows I've made myself, which all have about the same name.

To hide the button on the taskbar you need to set another GUI as the "parent" in the GUICreate call. So it sounds like you could do with a "master" GUI with all the others as children. :)

Is that enough to get you going? :huh:

Well, both yay and nay.

I've tried with a hidden GUI as I don't want to have another window active and primary all the GUIs in this script are made dynamically, but I couldn't get that to work.

When I try to minimize child GUIs whos parent is hidden they don't have anywhere to go, so to say. See my attachment at the bottom.

Have a look at the script in it's whole. And I'm sorry if some of the texts are hard to understand as the are in swedish, but all of the relevant text should be in proper english :)

#cs
Unlimited, controllable windows

$WinArray[n][0] = GUI winhandle
$WinArray[n][1] = Rich winhandle
$WinArray[n][2] = GUI height
$WinArray[n][3] = GUI width
$WinArray[n][4] = Rich color
$WinArray[n][5] = Rich textsize

$SaveArray[0] = GUI-name minus "LAN-notes"
$SaveArray[1] =
#ce
Opt("GUIOnEventMode", 1)
Opt("TrayMenuMode", 1 + 2)
Opt("TrayOnEventMode",1)
#include <array.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <TrayConstants.au3>
#include <GuiRichEdit.au3>
#include <GuiMenu.au3>
#include <GuiComboBox.au3>
#include <Color.au3>

TrayCreateItem("LAN-notes")
TrayItemSetState(-1, $TRAY_DISABLE)
TrayCreateItem("")
TrayCreateItem("Ny lapp")
TrayItemSetOnEvent(-1, "New")
TrayCreateItem("")
TrayCreateItem("Följ lapp")
TrayItemSetOnEvent(-1, "LoadList")
TrayCreateItem("")
TrayCreateItem("Stäng av")
TrayItemSetOnEvent(-1,"TrayExit")
TraySetState(1)

Global Enum $idCopy = 1000, $idPaste, $idUndo, $idSelectAll, $idFontsize, $idBkColor, $idCut, $idTest

Global $WinArray[1][6], $GUI_Size[4], $Font_hFont ,$BkColor_RedInputPrev = 0, $BkColor_GreenInputPrev = 0, $BkColor_BlueInputPrev = 0, _
    $BkColor_RedInputPrevSaved = 0, $BkColor_GreenInputPrevSaved = 0, $BkColor_BlueInputPrevSaved = 0, $ColorEventsVal = 0, $BkColor_OK, $BkColor_Cancel, $FontEventsVal = 0, _
    $Font_OK, $Font_Cancel

$hWnd = GUICreate("",0,0) ;-------------------------------------------------- Hidden parentGUI
GUISetState(@SW_HIDE,-1)

Call("New")
while 1
    Sleep(10)
    $Current_GUI = WinGetHandle("[ACTIVE]")
    If _ArraySearch($WinArray,$Current_GUI) <> -1 And WinGetState($Current_GUI) = BitOR(1,2,4,8) Then
        $GUI_Size = WinGetPos($Current_GUI)
        $Current_Rich = $WinArray[_ArraySearch($WinArray,$Current_GUI)][1]
        ;$Rich_Size = GUICtrlSetPos($Current_Rich)
        If $GUI_Size[2] <> $WinArray[_ArraySearch($WinArray,$Current_GUI)][2] Or $GUI_Size[3] <> $WinArray[_ArraySearch($WinArray,$Current_GUI)][3] Then
            _WinAPI_MoveWindow($Current_Rich,0,20,$GUI_Size[2]-20,$GUI_Size[3]-60)
            $WinArray[_ArraySearch($WinArray,$Current_GUI)][2] = $GUI_Size[2]
            $WinArray[_ArraySearch($WinArray,$Current_GUI)][3] = $GUI_Size[3]
        EndIf
    EndIf
WEnd

Func New()
ReDim $WinArray[UBound($WinArray,1)+1][6]

$WinArray[UBound($WinArray,1)-1][0] = GUICreate("LAN-notes - ",200,200,Default,Default,BitOR($ws_sizebox,$WS_MINIMIZEBOX),-1,$hWnd) ;-------------------------------------------------- Dynamical childGUIs
$WinArray[UBound($WinArray,1)-1][2] = 200
$WinArray[UBound($WinArray,1)-1][3] = 200
$WinArray[UBound($WinArray,1)-1][4] = "255,255,255"
$WinArray[UBound($WinArray,1)-1][5] = 8

GUISetOnEvent($GUI_EVENT_CLOSE, "MainEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "MainEvents")
GUICtrlCreateButton("+",0,0,20,20)
    GUICtrlSetTip(-1,"Skapa ny lapp")
    GUICtrlSetFont(-1,12)
    GUICtrlSetOnEvent(-1,"New")
GUICtrlCreateButton("Spara",20,0,35,20)
    GUICtrlSetOnEvent(-1,"Save")
;GUICtrlCreateButton("Test", 50,80)
    ;GUICtrlSetOnEvent(-1,"Test")
GUICtrlCreateInput("",55,0,105,20)
    GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlCreateButton("Ändra",160,0,35,20)
    GUICtrlSetOnEvent(-1,"EditProjName")
$WinArray[UBound($WinArray,1)-1][1] = _GUICtrlRichEdit_Create($WinArray[UBound($WinArray,1)-1][0], "",0,25,180,160, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_WANTRETURN,$ES_MULTILINE))
_GUICtrlRichEdit_SetFont($WinArray[UBound($WinArray,1)-1][1], 8)

Global $hMenu = _GUICtrlMenu_CreatePopup()

_GUICtrlMenu_AddMenuItem($hMenu, "Ångra", $idUndo)
_GUICtrlMenu_AddMenuItem($hMenu, "")
_GUICtrlMenu_AddMenuItem($hMenu, "Klipp ut", $idCut)
_GUICtrlMenu_AddMenuItem($hMenu, "Kopiera", $idCopy)
_GUICtrlMenu_AddMenuItem($hMenu, "Klistra in", $idPaste)
_GUICtrlMenu_AddMenuItem($hMenu, "Markera allt", $idSelectAll)
_GUICtrlMenu_AddMenuItem($hMenu, "")
_GUICtrlMenu_AddMenuItem($hMenu, "Textstorlek", $idFontsize)
_GUICtrlMenu_AddMenuItem($hMenu, "Bakgrundsfärg", $idBkColor)
_GUICtrlMenu_AddMenuItem($hMenu, "")
_GUICtrlMenu_AddMenuItem($hMenu, "Test", $idTest)

Global $wProcHandle = DllCallbackRegister("_WindowProc", "ptr", "hwnd;uint;wparam;lparam")

Global $wProcOld = _WinAPI_SetWindowLong($WinArray[UBound($WinArray,1)-1][1], $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle))

GUISetState()

EndFunc

Func Test($RichTest)
    If _GUICtrlRichEdit_GetTextLength($RichTest, True, True) > 0 Then
        Local $RichPrevFontSize, $RichPrevFontSizeChange, $RichStringFonts, $RichCurrentFontSize
        For $1 = 0 To _GUICtrlRichEdit_GetTextLength($RichTest, True, True) Step +1
            _GUICtrlRichEdit_SetSel($RichTest,$1,$1)
            If $1 = 0 Then
                $RichPrevFontSize = _GUICtrlRichEdit_GetFont($RichTest)
                $RichPrevFontSizeChange = $1
                $RichStringFonts = String("<" & $RichPrevFontSize[0] & ">")
            ElseIf $1 > 0 Then
                $RichCurrentFontSize = _GUICtrlRichEdit_GetFont($RichTest)
                If $RichCurrentFontSize[0] <> $RichPrevFontSize[0] Then
                    $RichCurrentFontSizeChange = $1-1
                    If $RichPrevFontSizeChange <> 0 Then $RichPrevFontSizeChange = $RichPrevFontSizeChange-1
                    $RichStringFonts = String($RichStringFonts & _GUICtrlRichEdit_GetTextInRange($RichTest,$RichPrevFontSizeChange,$RichCurrentFontSizeChange) & "<" & $RichPrevFontSize[0] & ">" & "<" & $RichCurrentFontSize[0] & ">")
                    $RichPrevFontSize[0] = $RichCurrentFontSize[0]
                    $RichPrevFontSizeChange = $1
                EndIf
            EndIf
        Next
        If $RichPrevFontSizeChange <> 0 Then $RichPrevFontSizeChange = $RichPrevFontSizeChange-1
        $RichStringFonts = String($RichStringFonts & _GUICtrlRichEdit_GetTextInRange($RichTest,$RichPrevFontSizeChange, $1) & "<" & $RichPrevFontSize[0] & ">")
        ConsoleWrite($RichStringFonts & @CRLF)
    EndIf
EndFunc

Func MainEvents()
    Select
        Case @GUI_CtrlId = $GUI_EVENT_CLOSE
            If WinExists("LAN-notes - ") Then
                If MsgBox(4,"Stäng?","Är du säker på att du vill stänga lappen?") = 6 Then
                    For $1 = (_ArraySearch($WinArray,@GUI_WinHandle)) To (UBound($WinArray,1)-2) Step +1
                        $WinArray[$1][0] = $WinArray[$1+1][0]
                        $WinArray[$1][1] = $WinArray[$1+1][1]
                        $WinArray[$1][2] = $WinArray[$1+1][2]
                        $WinArray[$1][3] = $WinArray[$1+1][3]
                    Next
                    ReDim $WinArray[UBound($WinArray,1)-1][4]
                    GUIDelete(@GUI_WinHandle)
                EndIf
            EndIf
    EndSelect
EndFunc

Func EditProjName()
    ConsoleWrite("Edit projName" & @CRLF)
    If GUICtrlGetState(@GUI_CtrlId-1) = 144 Then
        GUICtrlSetState(@GUI_CtrlId-1,$GUI_ENABLE)
        GUICtrlSetData(@GUI_CtrlId,"Klar")
    Else
        WinSetTitle(@GUI_WinHandle,"","LAN-notes - " & GUICtrlRead(@GUI_CtrlId-1))
        GUICtrlSetState(@GUI_CtrlId-1,$GUI_DISABLE)
        GUICtrlSetData(@GUI_CtrlId,"Ändra")
    EndIf
EndFunc

Func Save()
    ConsoleWrite("--> Save" & @CRLF)
    ConsoleWrite(StringReplace(WinGetTitle(@GUI_WinHandle),"LAN-notes - ","") & @CRLF)
EndFunc

Func TrayExit()
    ConsoleWrite("TrayExit")
    If MsgBox(4,"Stäng?","Är du säker på att du vill stänga av?") = 6 Then
        DllCallbackFree($wProcHandle)
        Exit
    EndIf
EndFunc

Func _WindowProc($hWnd, $Msg, $wParam, $lParam)
    $GUI = WinActive("LAN-notes - ")
    If _ArraySearch($WinArray,$GUI) <> -1 Then
    Switch $hWnd
        Case $WinArray[_ArraySearch($WinArray,$GUI)][1]
            Switch $Msg
                Case $WM_RBUTTONUP
                    ConsoleWrite("-> Rightclick" & @LF)
                    _GUICtrlMenu_TrackPopupMenu($hMenu, $hWnd)
                    Return 0
                Case $WM_COMMAND
                    Switch $wParam
                        Case $idCut
                            ConsoleWrite("-> Cut" & @LF)
                            _GUICtrlRichEdit_Cut($WinArray[_ArraySearch($WinArray,$GUI)][1])
                        Case $idCopy
                            ConsoleWrite("-> Copy" & @LF)
                            _GUICtrlRichEdit_Copy($WinArray[_ArraySearch($WinArray,$GUI)][1])
                        Case $idPaste
                            ConsoleWrite("-> Paste" & @LF)
                            _GUICtrlRichEdit_Paste($WinArray[_ArraySearch($WinArray,$GUI)][1])
                        Case $idUndo
                            ConsoleWrite("-> Undo" & @LF)
                            _GUICtrlRichEdit_Undo($WinArray[_ArraySearch($WinArray,$GUI)][1])
                        Case $idSelectAll
                            ConsoleWrite("-> Select all" & @LF)
                            _GUICtrlRichEdit_SetSel($WinArray[_ArraySearch($WinArray,$GUI)][1],0,StringLen(_GUICtrlRichEdit_GetText($WinArray[_ArraySearch($WinArray,$GUI)][1])))
                        Case $idFontsize
                            ConsoleWrite("-> Size" &@LF)
                            $Return_Font = _Fontsize($GUI,$WinArray[_ArraySearch($WinArray,$GUI)][5])
                            ConsoleWrite($Return_Font&@CRLF)
                            If $Return_Font <> 0 Then
                                $Text_Selected = _GUICtrlRichEdit_GetSel($WinArray[_ArraySearch($WinArray,$GUI)][1])
                                If $Text_Selected[0] = $Text_Selected[1] Then
                                    _GUICtrlRichEdit_SetSel($WinArray[_ArraySearch($WinArray,$GUI)][1],0,_GUICtrlRichEdit_GetTextLength($WinArray[_ArraySearch($WinArray,$GUI)][1],True,True))
                                    _GUICtrlRichEdit_SetFont($WinArray[_ArraySearch($WinArray,$GUI)][1],$Return_Font)
                                    _GUICtrlRichEdit_SetSel($WinArray[_ArraySearch($WinArray,$GUI)][1],$Text_Selected[0],$Text_Selected[0])
                                Else
                                    _GUICtrlRichEdit_SetFont($WinArray[_ArraySearch($WinArray,$GUI)][1],$Return_Font)
                                EndIf
                            EndIf
                        Case $idBkColor
                            ConsoleWrite("-> BkColor" &@LF)
                            $Return_BkColor = _BkColor($GUI)
                            If $Return_BkColor <> 0 Then _GUICtrlRichEdit_SetBkColor($WinArray[_ArraySearch($WinArray,$GUI)][1],$Return_BkColor)
                        Case $idTest
                            ConsoleWrite("-> Test" &@LF)
                            Call("Test",$WinArray[_ArraySearch($WinArray,$GUI)][1])
                    EndSwitch
            EndSwitch
    EndSwitch
    endif
    Local $aRet = DllCall("user32.dll", "int", "CallWindowProc", "ptr", $wProcOld, _
                          "hwnd", $hWnd, "uint", $Msg, "wparam", $wParam, "lparam", $lParam)
    Return $aRet[0]
EndFunc

Func _BkColor($hGui)
    $PrevBkColors = StringSplit($WinArray[_ArraySearch($WinArray,$hGui)][4],",")
    $BkColor_RedInputPrevSaved = $PrevBkColors[1]
    $BkColor_GreenInputPrevSaved = $PrevBkColors[2]
    $BkColor_BlueInputPrevSaved = $PrevBkColors[3]
    $hGui_BkColor = GUICreate("Ställ bakgrundsfärg", 250,150,-1,-1,$WS_border, -1,$hGui)
    $BkColor_MainInput = GUICtrlCreateCombo("Vit", 90,15,70)
    If $BkColor_RedInputPrevSaved = 255 And $BkColor_GreenInputPrevSaved = 255 And $BkColor_BlueInputPrevSaved = 255 Then GUICtrlSetData(-1,"Röd|Grön|Blå|Svart|Egen","Vit")
    If $BkColor_RedInputPrevSaved = 255 And $BkColor_GreenInputPrevSaved = 0 And $BkColor_BlueInputPrevSaved = 0 Then GUICtrlSetData(-1,"Röd|Grön|Blå|Svart|Egen","Röd")
    If $BkColor_RedInputPrevSaved = 0 And $BkColor_GreenInputPrevSaved = 255 And $BkColor_BlueInputPrevSaved = 0 Then GUICtrlSetData(-1,"Röd|Grön|Blå|Svart|Egen","Grön")
    If $BkColor_RedInputPrevSaved = 0 And $BkColor_GreenInputPrevSaved = 0 And $BkColor_BlueInputPrevSaved = 255 Then GUICtrlSetData(-1,"Röd|Grön|Blå|Svart|Egen","Blå")
    If $BkColor_RedInputPrevSaved = 0 And $BkColor_GreenInputPrevSaved = 0 And $BkColor_BlueInputPrevSaved = 0 Then GUICtrlSetData(-1,"Röd|Grön|Blå|Svart|Egen","Svart")
    If ($BkColor_RedInputPrevSaved <> 0 And $BkColor_RedInputPrevSaved <> 255) Or ($BkColor_GreenInputPrevSaved <> 0 And $BkColor_GreenInputPrevSaved <> 255) Or _
        ($BkColor_BlueInputPrevSaved <> 0 And $BkColor_BlueInputPrevSaved <> 255) Then GUICtrlSetData(-1,"Röd|Grön|Blå|Svart|Egen","Egen")
    GUICtrlCreateLabel("Röd", 10,40,30)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlCreateLabel("Grön", 10,60,30)
    GUICtrlSetColor(-1, 0x00FF00)
    GUICtrlCreateLabel("Blå", 10,80,30)
    GUICtrlSetColor(-1, 0x0000FF)
    $BkColor_Red = GUICtrlCreateSlider(35,40,120,-1)
    GUICtrlSetLimit(-1,255)
    GUICtrlSetData(-1, $BkColor_RedInputPrevSaved)
    $BkColor_Green = GUICtrlCreateSlider(35,60,120,-1)
    GUICtrlSetLimit(-1,255)
    GUICtrlSetData(-1, $BkColor_GreenInputPrevSaved)
    $BkColor_Blue = GUICtrlCreateSlider(35,80,120,-1)
    GUICtrlSetLimit(-1,255)
    GUICtrlSetData(-1,$BkColor_BlueInputPrevSaved)
    $BkColor_RedInput = GUICtrlCreateInput($BkColor_RedInputPrevSaved,160,40,40,20,$ES_NUMBER)
    GUICtrlSetLimit(-1,255)
    $BkColor_GreenInput = GUICtrlCreateInput($BkColor_GreenInputPrevSaved,160,60,40,20,$ES_NUMBER)
    GUICtrlSetLimit(-1,255)
    $BkColor_BlueInput = GUICtrlCreateInput($BkColor_BlueInputPrevSaved,160,80,40,20,$ES_NUMBER)
    GUICtrlSetLimit(-1,255)
    $BkColor_OK = GUICtrlCreateButton("OK", 25,100,50,25)
    GUICtrlSetOnEvent(-1,"ColorEvents")
    $BkColor_Cancel = GUICtrlCreateButton("Avbryt", 75,100,50,25)
    GUICtrlSetOnEvent(-1,"ColorEvents")
    Local $BkColor_RedPrev = $BkColor_RedInputPrevSaved, $BkColor_GreenPrev = $BkColor_GreenInputPrevSaved, $BkColor_BluePrev = $BkColor_BlueInputPrevSaved, $BkColor_MainInputPrev
    $BkColor_Prev = $BkColor_RedInputPrevSaved*65536+$BkColor_GreenInputPrevSaved*256+$BkColor_BlueInputPrevSaved
    $BkColor_ExampleColor = GUICtrlCreateLabel("",210,40,30,60)
    GUICtrlSetColor(-1, $BkColor_Prev)
    GUISetState(@SW_DISABLE, $hGui)
    GUISetState(@SW_SHOW, $hGui_BkColor)
    While 1
        If _GUICtrlComboBox_GetDroppedState($BkColor_MainInput) = False Then
            If $ColorEventsVal = 1 Then
                GUIDelete($hGui_BkColor)
                GUISetState(@SW_ENABLE,$hGui)
                WinActivate($hGui)
                $ColorEventsVal = 0
                Return 0
                ExitLoop
            ElseIf $ColorEventsVal = 2 Then
                $WinArray[_ArraySearch($WinArray,$hGui)][4] = GUICtrlRead($BkColor_RedInput)&","&GUICtrlRead($BkColor_GreenInput)&","&GUICtrlRead($BkColor_BlueInput)
                Local $BkColor_ColorArray[3] = [GUICtrlRead($BkColor_RedInput), GUICtrlRead($BkColor_GreenInput), GUICtrlRead($BkColor_BlueInput)]
                $BkColor_Color = _ColorSetCOLORREF($BkColor_ColorArray)
                ConsoleWrite($BkColor_Color&@CRLF)
                GUIDelete($hGui_BkColor)
                GUISetState(@SW_ENABLE,$hGui)
                WinActivate($hGui)
                $ColorEventsVal = 0
                Return $BkColor_Color
                ExitLoop
            EndIf
        If GUICtrlRead($BkColor_MainInput) <> $BkColor_MainInputPrev Then
            ConsoleWrite(GUICtrlRead($BkColor_MainInput)&@CRLF)
            If GUICtrlRead($BkColor_MainInput) = "Vit" Then
                ConsoleWrite("Set to white"&@CRLF)
                GUICtrlSetData($BkColor_Red,255)
                $BkColor_RedPrev = 255
                GUICtrlSetData($BkColor_RedInput,255)
                $BkColor_RedInputPrev = 255
                GUICtrlSetData($BkColor_Green,255)
                $BkColor_GreenPrev = 255
                GUICtrlSetData($BkColor_GreenInput,255)
                $BkColor_GreenInputPrev = 255
                GUICtrlSetData($BkColor_Blue,255)
                $BkColor_BluePrev = 255
                GUICtrlSetData($BkColor_BlueInput,255)
                $BkColor_BlueInputPrev = 255
            EndIf
            If GUICtrlRead($BkColor_MainInput) =  "Röd" Then
                ConsoleWrite("Set to red"&@CRLF)
                GUICtrlSetData($BkColor_Red,255)
                $BkColor_RedPrev = 255
                GUICtrlSetData($BkColor_RedInput,255)
                $BkColor_RedInputPrev = 255
                GUICtrlSetData($BkColor_Green,0)
                $BkColor_GreenPrev = 0
                GUICtrlSetData($BkColor_GreenInput,0)
                $BkColor_GreenInputPrev = 0
                GUICtrlSetData($BkColor_Blue,0)
                $BkColor_BluePrev = 0
                GUICtrlSetData($BkColor_BlueInput,0)
                $BkColor_BlueInputPrev = 0
            EndIf
            If GUICtrlRead($BkColor_MainInput) =  "Grön" Then
                ConsoleWrite("Set to green"&@CRLF)
                GUICtrlSetData($BkColor_Red,0)
                $BkColor_RedPrev = 0
                GUICtrlSetData($BkColor_RedInput,0)
                $BkColor_RedInputPrev = 0
                GUICtrlSetData($BkColor_Green,255)
                $BkColor_GreenPrev = 255
                GUICtrlSetData($BkColor_GreenInput,255)
                $BkColor_GreenInputPrev = 255
                GUICtrlSetData($BkColor_Blue,0)
                $BkColor_BluePrev = 0
                GUICtrlSetData($BkColor_BlueInput,0)
                $BkColor_BlueInputPrev = 0
            EndIf
            If GUICtrlRead($BkColor_MainInput) =  "Blå" Then
                ConsoleWrite("Set to blue"&@CRLF)
                GUICtrlSetData($BkColor_Red,0)
                $BkColor_RedPrev = 0
                GUICtrlSetData($BkColor_RedInput,0)
                $BkColor_RedInputPrev = 0
                GUICtrlSetData($BkColor_Green,0)
                $BkColor_GreenPrev = 0
                GUICtrlSetData($BkColor_GreenInput,0)
                $BkColor_GreenInputPrev = 0
                GUICtrlSetData($BkColor_Blue,255)
                $BkColor_BluePrev = 255
                GUICtrlSetData($BkColor_BlueInput,255)
                $BkColor_BlueInputPrev = 255
            EndIf
            If GUICtrlRead($BkColor_MainInput) =  "Svart" Then
                ConsoleWrite("Set to black"&@CRLF)
                GUICtrlSetData($BkColor_Red,0)
                $BkColor_RedPrev = GUICtrlRead($BkColor_Red)
                GUICtrlSetData($BkColor_RedInput,0)
                $BkColor_RedInputPrev = GUICtrlRead($BkColor_RedInput)
                GUICtrlSetData($BkColor_Green,0)
                $BkColor_GreenPrev = GUICtrlRead($BkColor_Green)
                GUICtrlSetData($BkColor_GreenInput,0)
                $BkColor_GreenInputPrev = GUICtrlRead($BkColor_GreenInput)
                GUICtrlSetData($BkColor_Blue,0)
                $BkColor_BluePrev = GUICtrlRead($BkColor_Blue)
                GUICtrlSetData($BkColor_BlueInput,0)
                $BkColor_BlueInputPrev = GUICtrlRead($BkColor_BlueInput)
            EndIf
            $BkColor_MainInputPrev = GUICtrlRead($BkColor_MainInput)
        EndIf
        If GUICtrlRead($BkColor_RedInput) > 255 Then
            GUICtrlSetData($BkColor_Red,255)
            GUICtrlSetData($BkColor_RedInput,255)
            $BkColor_RedPrev = 255
            $BkColor_RedInputPrev = 255
        EndIf
        If GUICtrlRead($BkColor_GreenInput) > 255 Then
            GUICtrlSetData($BkColor_Green,255)
            GUICtrlSetData($BkColor_GreenInput,255)
            $BkColor_GreenPrev = 255
            $BkColor_GreenInputPrev = 255
        EndIf
        If GUICtrlRead($BkColor_BlueInput) > 255 Then
            GUICtrlSetData($BkColor_Blue,255)
            GUICtrlSetData($BkColor_BlueInput,255)
            $BkColor_BluePrev = 255
            $BkColor_BlueInputPrev = 255
        EndIf
        $BkColor_ZerocheckRed = StringSplit(GUICtrlRead($BkColor_RedInput),"")
        $BkColor_ZerocheckGreen = StringSplit(GUICtrlRead($BkColor_GreenInput),"")
        $BkColor_ZerocheckBlue = StringSplit(GUICtrlRead($BkColor_BlueInput),"")
        If $BkColor_ZerocheckRed[0] > 1 And $BkColor_ZerocheckRed[1] = "0" Then GUICtrlSetData($BkColor_RedInput,StringReplace(GUICtrlRead($BkColor_RedInput),"0","",1))
        If $BkColor_ZerocheckGreen[0] > 1 And $BkColor_ZerocheckGreen[1] = "0" Then GUICtrlSetData($BkColor_GreenInput,StringReplace(GUICtrlRead($BkColor_GreenInput),"0","",1))
        If $BkColor_ZerocheckBlue[0] > 1 And $BkColor_ZerocheckBlue[1] = "0" Then GUICtrlSetData($BkColor_BlueInput,StringReplace(GUICtrlRead($BkColor_BlueInput),"0","",1))
        $BkColor_ReadRed = GUICtrlRead($BkColor_Red)
        $BkColor_ReadGreen = GUICtrlRead($BkColor_Green)
        $BkColor_ReadBlue = GUICtrlRead($BkColor_Blue)
        $BkColor_ReadRedInput = GUICtrlRead($BkColor_RedInput)
        $BkColor_ReadGreenInput = GUICtrlRead($BkColor_GreenInput)
        $BkColor_ReadBlueInput = GUICtrlRead($BkColor_BlueInput)
        If $BkColor_ReadRedInput <> $BkColor_RedPrev Or $BkColor_ReadRed <> $BkColor_RedPrev Then
            If $BkColor_ReadRedInput <> $BkColor_RedPrev Then
                GUICtrlSetData($BkColor_Red,$BkColor_ReadRedInput)
                $BkColor_RedPrev = $BkColor_ReadRedInput
            ElseIf $BkColor_ReadRed <> $BkColor_RedPrev Then
                GUICtrlSetData($BkColor_RedInput,$BkColor_ReadRed)
                $BkColor_RedInputPrev = $BkColor_ReadRed
            EndIf
        EndIf

        If $BkColor_ReadGreenInput <> $BkColor_GreenPrev Or $BkColor_ReadGreen <> $BkColor_GreenPrev Then
            If $BkColor_ReadGreenInput <> $BkColor_GreenPrev Then
                GUICtrlSetData($BkColor_Green,$BkColor_ReadGreenInput)
                $BkColor_GreenPrev = $BkColor_ReadGreenInput
            ElseIf $BkColor_ReadGreen <> $BkColor_GreenPrev Then
                GUICtrlSetData($BkColor_GreenInput,$BkColor_ReadGreen)
                $BkColor_GreenInputPrev = $BkColor_ReadGreen
            EndIf
        EndIf

        If $BkColor_ReadBlueInput <> $BkColor_BluePrev Or $BkColor_ReadBlue <> $BkColor_BluePrev Then
            If $BkColor_ReadBlueInput <> $BkColor_BluePrev Then
                GUICtrlSetData($BkColor_Blue,$BkColor_ReadBlueInput)
                $BkColor_BluePrev = $BkColor_ReadBlueInput
            ElseIf $BkColor_ReadBlue <> $BkColor_BluePrev Then
                GUICtrlSetData($BkColor_BlueInput,$BkColor_ReadBlue)
                $BkColor_BlueInputPrev = $BkColor_ReadBlue
            EndIf
        EndIf

    If $BkColor_RedPrev = 255 And $BkColor_GreenPrev = 255 And $BkColor_BluePrev = 255 And GUICtrlRead($BkColor_MainInput) <> "Vit" Then _GUICtrlComboBox_SetCurSel($BkColor_MainInput,0)
    If $BkColor_RedPrev = 255 And $BkColor_GreenPrev = 0 And $BkColor_BluePrev = 0 And GUICtrlRead($BkColor_MainInput) <> "Röd" Then _GUICtrlComboBox_SetCurSel($BkColor_MainInput,1)
    If $BkColor_RedPrev = 0 And $BkColor_GreenPrev = 255 And $BkColor_BluePrev = 0 And GUICtrlRead($BkColor_MainInput) <> "Grön" Then _GUICtrlComboBox_SetCurSel($BkColor_MainInput,2)
    If $BkColor_RedPrev = 0 And $BkColor_GreenPrev = 0 And $BkColor_BluePrev = 255 And GUICtrlRead($BkColor_MainInput) <> "Blå" Then _GUICtrlComboBox_SetCurSel($BkColor_MainInput,3)
    If $BkColor_RedPrev = 0 And $BkColor_GreenPrev = 0 And $BkColor_BluePrev = 0 And GUICtrlRead($BkColor_MainInput) <> "Svart" Then _GUICtrlComboBox_SetCurSel($BkColor_MainInput,4)
    If ($BkColor_RedPrev <> 0 And $BkColor_RedPrev <> 255 And GUICtrlRead($BkColor_MainInput) <> "Egen") Or ($BkColor_GreenPrev <> 0 And $BkColor_GreenPrev <> 255 And GUICtrlRead($BkColor_MainInput) <> "Egen") Or _
        ($BkColor_BluePrev <> 0 And $BkColor_BluePrev <> 255 And GUICtrlRead($BkColor_MainInput) <> "Egen") Then _GUICtrlComboBox_SetCurSel($BkColor_MainInput,5)
    EndIf
    $BkColor =     $BkColor_RedPrev*65536+$BkColor_GreenPrev*256+$BkColor_BluePrev
    If $BkColor <> $BkColor_Prev Then
        GUICtrlSetBkColor($BkColor_ExampleColor,$BkColor)
        $BkColor_Prev = $BkColor
    EndIf
    WEnd
EndFunc

Func ColorEvents()
    switch @GUI_CtrlId
        Case $BkColor_OK
            $ColorEventsVal = 2
        Case $BkColor_Cancel
            $ColorEventsVal = 1
    EndSwitch
EndFunc

Func _Fontsize($hGui,$Font_PrevSize)
    $hGui_fontsize = GUICreate("Ställ textstorlek", 150,150,-1,-1,$WS_border,-1,$hGui)
    $Font_Input = GUICtrlCreateInput($Font_PrevSize,50,15,50)
    GUICtrlCreateUpdown(-1)
    GUICtrlSetLimit(-1, 50,8)
    $Font_ExampleLable = GUICtrlCreateLabel("Ex",60,40,100,75)
    GUICtrlSetState(-1,$gui_disable)
    GUICtrlSetFont(-1,$Font_PrevSize)
    $Font_OK = GUICtrlCreateButton("OK", 25,100,50,25)
    GUICtrlSetOnEvent(-1, "FontEvents")
    $Font_Cancel = GUICtrlCreateButton("Avbryt", 75,100,50,25)
    GUICtrlSetOnEvent(-1, "FontEvents")
    GUISetState(@SW_DISABLE, $hGui)
    GUISetState(@SW_SHOW, $hGui_fontsize)
    While 1
        If $FontEventsVal = 1 Then
            GUIDelete($hGui_fontsize)
            GUISetState(@SW_ENABLE,$hGui)
            WinActivate($hGui)
            $FontEventsVal = 0
            Return 0
            ExitLoop
        ElseIf $FontEventsVal = 2 Then
            $WinArray[_ArraySearch($WinArray,$hGui)][5] = GUICtrlRead($Font_Input)
            GUIDelete($hGui_fontsize)
            GUISetState(@SW_ENABLE,$hGui)
            WinActivate($hGui)
            ConsoleWrite(GUICtrlRead($Font_Input)&@CRLF)
            $FontEventsVal = 0
            Return $WinArray[_ArraySearch($WinArray,$hGui)][5]
            ExitLoop
        EndIf
        $Font_CurrentSize = GUICtrlRead($Font_Input)
        If $Font_CurrentSize > 50 Then GUICtrlSetData($Font_Input,50)
        If $Font_CurrentSize < 8 Then GUICtrlSetData($Font_Input,8)
        If $Font_CurrentSize <> $Font_PrevSize Then
            GUICtrlSetFont($Font_ExampleLable,GUICtrlRead($Font_Input))
            GUICtrlSetPos($Font_ExampleLable,60-(GUICtrlRead($Font_Input)/2))
            $Font_PrevSize = $Font_CurrentSize
        EndIf
    WEnd
EndFunc

Func FontEvents()
    switch @GUI_CtrlId
        Case $Font_OK
            $FontEventsVal = 2
        Case $Font_Cancel
            $FontEventsVal = 1
    EndSwitch
EndFunc

Func LoadList()

EndFunc

DllCallbackFree($wProcHandle)

fehqfLj.png

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

zvvyt,

Firstly, you can use the hidden, but always present, AutoIt GUI as a parent:

$hWnd = WinGetHandle(AutoItWinGetTitle())
Next, I suggest preventing the default behaviour of the GUI for button events (Opt("GUIEventOptions", 1) and then adding some code to your MainEvents function to hide the GUI instead of minimizing it:

Func MainEvents()
    Select
        Case @GUI_CtrlId = $GUI_EVENT_CLOSE
            [...]
        Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE
            GUISetState(@SW_HIDE, @GUI_WinHandle)
    EndSelect
EndFunc   ;==>MainEvents
You will of course have to develop a way to get the GUI visible again when required. ;)

Finally, your script nearly always crashes on exit, but I have not yet discovered why. :(>

M23

Edit:

Found the problem - you should delete all the subclassed GUIs before freeing the replacement WndProc:

Func TrayExit()
    ConsoleWrite("TrayExit")
    If MsgBox(4, "Stäng?", "Är du säker på att du vill stänga av?") = 6 Then
        For $i = 0 To UBound($WinArray, 1) - 1
            GUIDelete($WinArray[$i][0])
        Next
        DllCallbackFree($wProcHandle)
        Exit
    EndIf
EndFunc   ;==>TrayExit
Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Firstly, you can use the hidden, but always present, AutoIt GUI as a parent:

$hWnd = WinGetHandle(AutoItWinGetTitle())

Grazie! 

Next, I suggest preventing the default behaviour of the GUI for button events (Opt("GUIEventOptions", 1) and then adding some code to your MainEvents function to hide the GUI instead of minimizing it:

You will of course have to develop a way to get the GUI visible again when required. ;)

Thanks, that's the exact way of putting me on the right track I was looking for!

But then I still don't have a "window" I can use to "restore"/show the GUIs again?

I could add a hide/show-function to the tray, but that is a step off my original path..

Finally, your script nearly always crashes on exit, but I have not yet discovered why. :(>

Found the problem - you should delete all the subclassed GUIs before freeing the replacement WndProc:

That's odd, as I'm not getting a single error when I run and/or close it..

But if it was as simple and fundamental as deleting the GUIs then I'm more than happy you pointed that out :)

Share this post


Link to post
Share on other sites

"Följ lapp"

Is it bad that I laughed at that? :P

(it's a Swedish thing)

Well, now I can't keep it like that..! xD

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

  • Similar Content

    • Miliardsto
      By Miliardsto
      Hello. How to make GUI restore from tray with slower speed or effect?
    • Miliardsto
      By Miliardsto
      Hello.
      Drag option works only on parent window but as we can see on the parent gui is showed up child gui (on the right side with the color).
      Desired action is when we want to drag whole program we can also drag child gui and child gui will drag with parent gui.
      How to do this?
       
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> GUIRegisterMsg($WM_NCHITTEST, "_NCHITTEST") $hGUI = GUICreate("Test", 500, 500, -1, -1) $cButton_0 = GUICtrlCreateButton("Child 0", 10, 10, 80, 30) $cButton_1 = GUICtrlCreateButton("Child 1", 10, 50, 80, 30) $cButton_2 = GUICtrlCreateButton("Child 2", 10, 90, 80, 30) GUISetState(@SW_SHOW, $hGUI) ; guis Global $hChild_[3] Global $countGUI = UBound($hChild_) - 1 ;MsgBox("","",$countGUI) ; licznik dla GUI Global $gui = 0 $hChild_[0] = GUICreate("Child 0", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0xFF0000) GUISetState(@SW_SHOW, $hChild_[0]) $hChild_[1] = GUICreate("Child 1", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0x00FF00) GUISetState(@SW_HIDE, $hChild_[1]) $hChild_[2] = GUICreate("Child 2", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0x0000FF) GUISetState(@SW_HIDE, $hChild_[2]) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton_0 _All_Hide() GUISetState(@SW_SHOW, $hChild_[0]) $gui = 0 Case $cButton_1 _All_Hide() GUISetState(@SW_SHOW, $hChild_[1]) $gui = 1 Case $cButton_2 _All_Hide() GUISetState(@SW_SHOW, $hChild_[2]) $gui = 2 EndSwitch WEnd Func _All_Hide() GUISetState(@SW_HIDE, $hChild_[0]) GUISetState(@SW_HIDE, $hChild_[1]) GUISetState(@SW_HIDE, $hChild_[2]) EndFunc Func _NCHITTEST($hWnd, $uMsg, $wParam, $lParam) If $hWnd = $hGUI Then Local $aPos = WinGetPos($hWnd) If Abs(BitAND(BitShift($lParam, 16),0xFFFF)- $aPos[1]) < 500 Then Return $HTCAPTION EndIf Return $GUI_RUNDEFMSG EndFunc  
    • IAMK
      By IAMK
      Hello,
       
      I have a script which uses a GUI with two buttons. It gets shown and hidden., and pressing the buttons (including their hotkeys) highlights the button, making you able to press enter the next time.
      However, I don't want that.
       
      I've tried using WinActivate() to make enter do things on another program, but the enter is still tied to the AutoIT GUI (which still has the button highlighted).
       
      Here's the important part of my code:
      $MY_GUI = GUICreate("Check.exe", 400, 300, ((@DesktopWidth / 2) - 200), -500) WinSetOnTop($MY_GUI, "", 1) ;Keeps the window on the top. $Button1 = GUICtrlCreateButton("Pass (Ctrl+P)", 40, 250, 120, 40, $WS_GROUP) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Fail (Ctrl+F)", 240, 250, 120, 40, $WS_GROUP) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $GUIText = GUICtrlCreateLabel("", 20, 10, 360, 230) GUICtrlSetFont(-1, 13, 400, 0, "MS Sans Serif") GUICtrlSetData($GUIText, Execute($stepMessage[$step])) $showGUI = "True" GUISetState(@SW_SHOW) While($showGUI = "True") $buttonPressed = GUIGetMsg() Switch $buttonPressed Case $Button1 ;Pass $pass = "True" $buttonPressed = 0 $showGUI = "False" GUISetState(@SW_HIDE) Case $Button2 ;Fail $buttonPressed = 0 $showGUI = "False" GUISetState(@SW_HIDE) While($message = "") $message = InputBox("Check.exe", "Please enter the reason the step failed." & @CRLF, "", "", 300, 200, ((@DesktopWidth / 2) - 150), -400) WEnd Return $message EndSwitch WEnd Local $pass = "False" ;Whether "Pass" or "Fail" was pressed. Local $failLog = xxxfunc($pass) ;Returns a message to log if the step failed. ##THIS CALLS THE CODE SNIPPET ABOVE## FileWrite($file, _Now() & ": Step " & $step & getStatus($pass) & "and took " & Ceiling(TimerDiff($timer) / 1000) & " seconds." & @CRLF) If($failLog <> "") Then FileWrite($file, "Logged comment: " & $failLog & @CRLF) EndIf WinActivate("[TITLE:ProgramName]") ;Hotkeys: HotKeySet("^{p}", "pressPass") HotKeySet("^{f}", "pressFail") Func pressPass() $buttonPressed = $Button1 EndFunc Func pressFail() $buttonPressed = $Button2 EndFunc  
      The GUI's button/hotkey pressing works correctly.
      The same WinActivate code works in another script of mine.
      Together, WinActivate is not take "Active" away from the GUI's last-pressed button. How do I fix this?
       
      Thank you in advance.
    • fatpig
      By fatpig
      Dear AutoIT Community.
      I am currently working on a program that will display lots of images in a scroll down GUI.
      I create the GUI based on the number of images, which works fine.
      But all images I place using GuiCtrlCreatePic above a threshold of around 32000 pixels (cant say exactly) are placed at negative locations and finally will reach 0 again
      and will then populate on top of the images placed there before.
      For $i = 1 To $Images[0] ; Get picture dimensions $hImage = _GDIPlus_ImageLoadFromFile($ImgRep & $Images[$i]) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) _GDIPlus_ImageDispose($hImage) ; Resize & place images in GUI $Pic[$i] = GUICtrlCreatePic($ImgRep & $Images[$i], $Spacer, Round($yPos, 0), $MaxImgWidth, $MaxImgWidth * ($iY / $iX)) $yPos = $yPos + $MaxImgWidth * ($iY / $iX) + $Spacer $log = $log & "|" & $yPos $currentlut = $Images[1] Next I have found a limit at 32767 pixels for some GUI elements when googling around.
      Can someone tell me how to circumvent that?
      thanks!
      cheers
      Felix
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys this is my gui and i need the numeric value typed in the highlighted  inputbox. if this value is greater than 1 i need to perform some operations
      \
       
      Here is the summary about that field which i got from wininfo tool

      i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... 

      here i am using the valu present in the field

      can you guys tell me what's wrong??? or how can i get that value?
       
      My_GUI.au3