#include #include #include #include #include #include #include #include #include "MetroGUI-UDF\MetroGUI_UDF.au3" ;!Highly recommended for improved overall performance and responsiveness of the GUI effects etc.! (after compiling): #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /rm /pe ;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling()) #AutoIt3Wrapper_Res_HiDpi=y _SetTheme("DarkMidnight") ;See MetroThemes.au3 for selectable themes or to add more ;Enable high DPI support: Detects the users DPI settings and resizes GUI and all controls to look perfectly sharp. _Metro_EnableHighDPIScaling() ; Note: Requries "#AutoIt3Wrapper_Res_HiDpi=y" for compiling. To see visible changes without compiling, you have to disable dpi scaling in compatibility settings of Autoit3.exe ;If not FileExists(@Scriptdir & "\INI\Namen\names.ini") Then ; SoundPlay("C:\WINDOWS\media\notify.wav",0) ; _Metro_MsgBox(0, "Waarschuwing!", "Database niet gevonden.", 250, 11, 3) ; with 3 secs timeout ; MsgBox(4096, "Waarschuwing!", "Database niet gevonden.") ; Exit ;EndIf $GUI = _Metro_CreateGUI("Hotkey", 248, 391, -1, -1, True) GUICtrlSetDefColor(0xFFFFFF, $GUI) GUICtrlCreateLabel("Naam:", 8, 40) SoundPlay("C:\WINDOWS\media\notify.wav",0) _Metro_MsgBox(0, "Starten", "Namen inlezen...", 180, 11, $GUI, 3) ; with 3 secs timeout $Combo = GUICtrlCreateCombo("", 8, 64, 161, 25, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) If FileExists(@ScriptDir & "\INI\Namen\names.ini") Then $var = IniReadSection(@ScriptDir & "\INI\Namen\names.ini", "Names") If @error <> 1 Then GUICtrlSetData($COMBO, "") For $x = 1 To $var[0][0] GUICtrlSetData($COMBO, $var[$x][0]) Next EndIf EndIf ;Add/create control buttons to the GUI $Control_Buttons = _Metro_AddControlButtons(False, False, False, False, True) ;CloseBtn = True, MaximizeBtn = True, MinimizeBtn = True, FullscreenBtn = True, MenuBtn = True ;Set variables for the handles of the GUI-Control buttons. (Above function always returns an array this size and in this order, no matter which buttons are selected. $GUI_CLOSE_BUTTON = $Control_Buttons[0] $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] $GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] $GUI_MENU_BUTTON = $Control_Buttons[6] ;====================================================================================================================================================================== ;Create an Array containing menu button names Dim $MenuButtonsArray[3] = ["Instellingen", "Minimaliseren", "Sluiten"] GUISetState(@SW_SHOW) While 1 _Metro_HoverCheck_Loop($GUI) ;This hover check has to be added to the main While loop, otherwise the hover effects won't work. $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_MENU_BUTTON Local $MenuSelect = _Metro_MenuStart($GUI, $GUI_MENU_BUTTON, 150, $MenuButtonsArray, "Segoe UI", 9, 0) ; Opens the metro Menu. See decleration of $MenuButtonsArray above. Switch $MenuSelect ;Above function returns the index number of the selected button from the provided buttons array. Case "0" $VAR = GUICtrlRead($COMBO) If $VAR = "" Then SoundPlay("C:\WINDOWS\media\notify.wav",0) _Metro_MsgBox(0, "Let op!", "Kies je naam...", 180, 11, $GUI, 3) Else SETTINGS() EndIf Case "1" GUISetState(@SW_MINIMIZE) Case "2" _Metro_GUIDelete($GUI) Exit EndSwitch Case $COMBO SETHOTKEY() EndSwitch WEnd ;==================================================================================================================================================================================== Func SETTINGS() $GUI2 = _Metro_CreateGUI("Instellingen", 260, 406, -1, -1, True) $NAME = GUICtrlRead($COMBO) $var = IniRead(@ScriptDir & "\INI\Namen\names.ini", "names", $NAME, "") GUICtrlCreateLabel($var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | ", 16, 16) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateLabel("CTRL +", 24, 44, 41, 17) GUICtrlSetColor(-1, 0xFFFFFF) $DEFAULT = GUICtrlCreateInput("", 72, 40, 33, 21, $ES_LOWERCASE) GUICtrlSetLimit(-1, 1) $var1 = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "standaard", "Q", "") GUICtrlSetData($DEFAULT, $var1) GUICtrlCreateLabel($var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | In behandeling | ", 16, 72) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateLabel("CTRL +", 24, 100, 41, 17) GUICtrlSetColor(-1, 0xFFFFFF) $BEHANDELING = GUICtrlCreateInput("", 72, 96, 33, 21) GUICtrlSetLimit(-1, 1) $var1 = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "behandeling", "B", "") GUICtrlSetData($BEHANDELING, $var1) GUICtrlCreateLabel($var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | Gebeld geen gehoor | ", 16, 128) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateLabel("CTRL +", 24, 156, 41, 17) GUICtrlSetColor(-1, 0xFFFFFF) $GEBELD = GUICtrlCreateInput("", 72, 152, 33, 21) GUICtrlSetLimit(-1, 1) $var1 = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "gebeld", "G", "") GUICtrlSetData($GEBELD, $var1) GUICtrlCreateLabel("mijnSalon - wachtwoord", 16, 184, 116, 17) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateLabel("CTRL +", 23, 211, 41, 17) GUICtrlSetColor(-1, 0xFFFFFF) $PASSW = GUICtrlCreateInput("", 72, 207, 33, 21) GUICtrlSetLimit(-1, 1) $var1 = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "passw", "D", "") GUICtrlSetData($PASSW, $var1) GUICtrlCreateLabel("Apollo CS wachtwoord", 16, 240, 111, 17) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateLabel("CTRL +", 23, 263, 41, 17) GUICtrlSetColor(-1, 0xFFFFFF) $PASSWA = GUICtrlCreateInput("", 72, 259, 33, 21) GUICtrlSetLimit(-1, 1) $var1 = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "passwa", "A", "") GUICtrlSetData($PASSWA, $var1) GUICtrlCreateLabel("Eigen zin", 16, 288, 47, 17) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateLabel("CTRL +", 23, 307, 41, 17) GUICtrlSetColor(-1, 0xFFFFFF) $EIGENZINKEY = GUICtrlCreateInput("", 72, 303, 33, 21) GUICtrlSetLimit(-1, 1) $var1 = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "zin", "Z", "") GUICtrlSetData($EIGENZINKEY, $var1) $EIGENZIN = GUICtrlCreateInput("", 16, 330, 233, 21) $var1 = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "zinfull", "X", "") GUICtrlSetData($EIGENZIN, $var1) $SAVE = _Metro_CreateButton("Opslaan", 172, 376, 75, 25) $RESET = _Metro_CreateButton("Wissen", 16, 376, 75, 25) GUISetState(@SW_SHOW) While 1 _Metro_HoverCheck_Loop($GUI2) $nMsg = GUIGetMsg() Switch $nMsg Case $RESET GUICtrlSetData($DEFAULT, "") GUICtrlSetData($BEHANDELING, "") GUICtrlSetData($GEBELD, "") GUICtrlSetData($PASSW, "") GUICtrlSetData($PASSWA, "") GUICtrlSetData($EIGENZINKEY, "") GUICtrlSetData($EIGENZIN, "") Case $SAVE $VAR2 = GUICtrlRead($DEFAULT) $VAR3 = GUICtrlRead($BEHANDELING) $VAR4 = GUICtrlRead($GEBELD) $VAR5 = GUICtrlRead($PASSW) $VAR6 = GUICtrlRead($PASSWA) $VAR7 = GUICtrlRead($EIGENZINKEY) $VAR8 = GUICtrlRead($EIGENZIN) IniWrite(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "standaard", "Q", $VAR2) IniWrite(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "behandeling", "B", $VAR3) IniWrite(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "gebeld", "G", $VAR4) IniWrite(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "passw", "D", $VAR5) IniWrite(@ScriptDir & "\INI\Namen\" & $NAME & ".ini", "passwa", "A", $VAR6) IniWrite(@ScriptDir & "\INI\Namen\" & $NAME & ".ini", "zin", "Z", $VAR7) IniWrite(@ScriptDir & "\INI\Namen\" & $NAME & ".ini", "zinfull", "X", $VAR8) SoundPlay("C:\WINDOWS\media\notify.wav",0) _Metro_MsgBox(0, "Opslaan", "Het programma sluit af om wijzigingen door te voeren.", 400, 11, $GUI, 3) ; with 3 secs timeout GUIDelete($GUI2) GUISetState($GUI, @SW_RESTORE) Exit EndSwitch WEnd EndFunc ;==================================================================================================================================================================================== Func SETHOTKEY() $NAME = GUICtrlRead($COMBO) $var = IniRead(@ScriptDir & "\INI\Namen\names.ini", "names", $NAME, "") $VARDEFAULT = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "standaard", "Q", "") HotKeySet("^" & $VARDEFAULT, "TIMESTAMP") $VARBEHANDELING = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "behandeling", "B", "") HotKeySet("^" & $VARBEHANDELING, "BEHANDELING") $VARGEBELD = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "gebeld", "G", "") HotKeySet("^" & $VARGEBELD, "GEENGEHOOR") $VARPASSW = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "passw", "D", "") HotKeySet("^" & $VARPASSW, "PASSWORD") $VARPASSWA = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "passwa", "A", "") HotKeySet("^" & $VARPASSWA, "PASSWORDA") $ZIN = IniRead(@ScriptDir & "\INI\Namen\" & $NAME & ".ini", "zin", "Z", "") HotKeySet("^" & $ZIN, "ZIN") GUICtrlCreateLabel($var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | ", 7, 64) GUICtrlCreateLabel("CTRL + " & $VARDEFAULT, 15, 88) GUICtrlCreateLabel($var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | In behandeling | ", 7, 112) GUICtrlCreateLabel("CTRL + " & $VARBEHANDELING, 15, 136) GUICtrlCreateLabel($var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | Gebeld geen gehoor | ", 7, 160) GUICtrlCreateLabel("CTRL + " & $VARGEBELD, 15, 184) GUICtrlCreateLabel("mijn Salon wachtwoord", 7, 208) GUICtrlCreateLabel("CTRL + " & $VARPASSW, 15, 231) GUICtrlCreateLabel("Apollo CS wachtwoord", 7, 256) GUICtrlCreateLabel("CTRL + " & $VARPASSWA, 15, 280) GUICtrlCreateLabel("Eigen zin", 7, 305) GUICtrlCreateLabel("CTRL + " & $ZIN, 15, 328) EndFunc ;==================================================================================================================================================================================== Func TIMESTAMP() $NAME = GUICtrlRead($COMBO) $var = IniRead(@ScriptDir & "\INI\Namen\names.ini", "names", $NAME, "") ControlSend("", "", "", $var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | ", 0) Sleep(50) EndFunc ;==================================================================================================================================================================================== Func BEHANDELING() $NAME = GUICtrlRead($COMBO) $var = IniRead(@ScriptDir & "\INI\Namen\names.ini", "names", $NAME, "") ControlSend("", "", "", $var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | In behandeling | ", 0) Sleep(50) EndFunc ;==================================================================================================================================================================================== Func GEENGEHOOR() $NAME = GUICtrlRead($COMBO) $var = IniRead(@ScriptDir & "\INI\Namen\names.ini", "names", $NAME, "") ControlSend("", "", "", $var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | Gebeld geen gehoor | ", 0) Sleep(50) EndFunc ;==================================================================================================================================================================================== Func PASSWORD() _Metro_MsgBox(0, "Warning!", "Disabled for post on forum!", 400, 11, $GUI, 3) ; with 3 secs timeout EndFunc ;==================================================================================================================================================================================== Func PASSWORDA() _Metro_MsgBox(0, "Warning!", "Disabled for post on forum!", 400, 11, $GUI, 3) ; with 3 secs timeout EndFunc ;==================================================================================================================================================================================== Func ZIN() $NAME = GUICtrlRead($COMBO) $var = IniRead(@ScriptDir & "\INI\Namen\" & $NAME & ".ini", "zinfull", "X", "") ControlSend("", "", "", $var) EndFunc ;==================================================================================================================================================================================== ;==================================================================================================================================================================================== Func _SecondGUI() Local $Form2 = _Metro_CreateGUI("Example2", 600, 400, -1, -1, True) ;Add control buttons Local $Control_Buttons_2 = _Metro_AddControlButtons(True, True, True, True) ;Set variables for control buttons Local $GUI_CLOSE_BUTTON = $Control_Buttons_2[0] Local $GUI_MAXIMIZE_BUTTON = $Control_Buttons_2[1] Local $GUI_RESTORE_BUTTON = $Control_Buttons_2[2] Local $GUI_MINIMIZE_BUTTON = $Control_Buttons_2[3] Local $GUI_FULLSCREEN_BUTTON = $Control_Buttons_2[4] Local $GUI_FSRestore_BUTTON = $Control_Buttons_2[5] Local $Button1 = _Metro_CreateButton("Close", 250, 340, 100, 40) GUICtrlSetResizing($Button1, 768 + 8) GUISetState(@SW_SHOW) While 1 _Metro_HoverCheck_Loop($Form2) ;Add hover check in loop $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON, $Button1 _Metro_GUIDelete($Form2) ;Delete GUI/release resources, make sure you use this when working with multiple GUIs! Return 0 Case $GUI_MAXIMIZE_BUTTON GUISetState(@SW_MAXIMIZE) Case $GUI_RESTORE_BUTTON GUISetState(@SW_RESTORE) Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE) Case $GUI_FULLSCREEN_BUTTON, $GUI_FSRestore_BUTTON _Metro_FullscreenToggle($Form2, $Control_Buttons_2) EndSwitch WEnd EndFunc ;==>_SecondGUI