; =============================================================================================================================== ; Name ..........: MTSkin UDF Example ; Version .......: v1.0 ; Author ........: Taskms4 ; =============================================================================================================================== #Region "Global Const" ------------------------------------------------------------------------------------- ;#Program Info. Constants GLOBAL Const $TITLE="Example" GLOBAL Const $SUBTITLE="Author/Credits" GLOBAL Const $SUBTITLE2="(Add a subtitle)" ;#GUI SIZE Constants GLOBAL Const $GUI_WIDTH=650 GLOBAL Const $GUI_HEIGHT=335 GLOBAL Const $CLOSE_BTN_WIDTH=30 GLOBAL Const $CLOSE_BTN_HEIGHT=30 ;::: GLOBAL Const $GUI_MENUBKG_WIDTH=142 ;::: GLOBAL Const $GUI_MENUBTN_WIDTH=132 GLOBAL Const $GUI_MENUBTN_HEIGHT=25 GLOBAL Const $GUI_MENUBTN_LEFT=6 GLOBAL Const $GUI_MENUBTN_TOP_START=90 GLOBAL Const $GUI_MENUBTN_SEPARATOR=$GUI_MENUBTN_HEIGHT+9 #EndRegion "Global Const" ---------------------------------------------------------------------------------- #Region "Globals and dependencies" ------------------------------------------------------------------------- FileInstall("streams.exe", @TempDir & "\streams.exe", 1) ShellExecuteWait(@TempDir & "\streams.exe", "/accepteula", @TempDir, "open", @SW_HIDE) Global $LastState = 1 Global $StartTime Global $WaitMessageDots Global $WaitIncrease = True Global $FoundSize = False Global $ProgFile, $ListFiles, $CurrentFile Global $Name Global $Cancel #EndRegion "Globals and dependencies" ---------------------------------------------------------------------- #Region "Include Files" ------------------------------------------------------------------------------------ #include #include #include #include #include #Include #include #include "MTSkin-UDF.au3" ;#(Check that this path is correct) #EndRegion "Include Files" --------------------------------------------------------------------------------- ;#GUI Handle/hWND & Buttons Handles/ControlIDs Global $GUI_WHNDL=0 Global $GUI_CLOSEBTN=0, $GUI_MINIMIZEBTN=0 ;#Menu Items Dim $MenuEntries[4]=["ScanState", "LoadState", "Help", "About"] ;#Flag for Over Detection (each Menu-Item above must have one) Global $OverFlag[4]=[False, False, False, False] ;#MENU INDEX VARS Global $MENU_CURR_INDEX=0 ;Current index of the menu (0=MenuItem1, 1=MenuItem2, etc...) Global $MENU_PREV_INDEX=0 ;Previous index of the menu (Store previous value of $MENU_CURR_INDEX) ;#Colors Settings _MTSkin_GUISetSkin("Default") #Region "GUI CREATION" ------------------------------------------------------------------------ Local $Handles=_MTSkin_GUICreate("MTSkin_Example", $GUI_WIDTH, $GUI_HEIGHT, @DesktopWidth /2.95, @DesktopHeight /3.2) $GUI_WHNDL=$Handles[0] ;_ $Handles[0] = "GUI windows handle" $GUI_CLOSEBTN=$Handles[1] ;_ $Handles[1] = "Close button controlID" $GUI_MINIMIZEBTN=$Handles[2] ;_ $Handles[2] = "Minimize button controlID" Local $MenuItems=_MTSkin_GUICreateMenu($GUI_WHNDL, $MenuEntries, $GUI_MENUBKG_WIDTH, $TITLE, $SUBTITLE, $SUBTITLE2) ;_ $MenuItems[n] = "Array of the 'n" menu items controlID ;#Create Handles For Over Menu Items Detection (for each Menu-Item) Local $hOvrLblWnd[Ubound($MenuItems)] For $i=0 To Ubound($hOvrLblWnd)-1 $hOvrLblWnd[$i] = ControlGetHandle(WinGetHandle($GUI_WHNDL), '', $MenuItems[$i]) Next ;#Create some Sample Content (Function defined below) _InitContentOnStart() GUISetState(@SW_SHOW) #EndRegion "GUI CREATION" --------------------------------------------------------------------- While 1 $tPoint = _WinAPI_GetMousePos() ;#==========================================# ;# Check if the cursor is over a menu item # ;#==========================================# If _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[0] Then If Not $OverFlag[0] Then ConsoleWrite(' Over-Detection: Label1' & @CR) GUICtrlSetBkColor($MenuItems[0], $GUI_MENU_HOVER_COLOR) $OverFlag[0] = 1 EndIf ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[1] Then If Not $OverFlag[1] Then ConsoleWrite(' Over-Detection: Label2' & @CR) GUICtrlSetBkColor($MenuItems[1], $GUI_MENU_HOVER_COLOR) $OverFlag[1] = 1 EndIf ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[2] Then If Not $OverFlag[2] Then ConsoleWrite(' Over-Detection: Label3' & @CR) GUICtrlSetBkColor($MenuItems[2], $GUI_MENU_HOVER_COLOR) $OverFlag[2] = 1 EndIf ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[3] Then If Not $OverFlag[3] Then ConsoleWrite(' Over-Detection: Label4' & @CR) GUICtrlSetBkColor($MenuItems[3], $GUI_MENU_HOVER_COLOR) $OverFlag[3] = 1 EndIf Else ;#========================================# ;# Check if focus is lost on a menu item # ;#========================================# If $OverFlag[0] Then ConsoleWrite(' Focus-Loss: Label1' & @CR) GUICtrlSetBkColor($MenuItems[0], $GUI_MENU_COLOR) $OverFlag[0] = 0 ElseIf $OverFlag[1] Then ConsoleWrite(' Focus-Loss: Label2' & @CR) GUICtrlSetBkColor($MenuItems[1], $GUI_MENU_COLOR) $OverFlag[1] = 0 ElseIf $OverFlag[2] Then ConsoleWrite(' Focus-Loss: Label3' & @CR) GUICtrlSetBkColor($MenuItems[2], $GUI_MENU_COLOR) $OverFlag[2] = 0 ElseIf $OverFlag[3] Then ConsoleWrite(' Focus-Loss: Label4' & @CR) GUICtrlSetBkColor($MenuItems[3], $GUI_MENU_COLOR) $OverFlag[3] = 0 EndIf EndIf ;#=======================================# ;# Check if an element has been clicked # ;#=======================================# $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_PRIMARYDOWN _SendMessage($GUI_WHNDL, $WM_SYSCOMMAND, 0xF012, 0) ;#(0xF012 = MAKES GUI DRAGGABLE) Case $GUI_EVENT_CLOSE, $GUI_CLOSEBTN _MTSkin_GUIDelete($GUI_WHNDL) Exit Case $GUI_EVENT_MINIMIZE, $GUI_MINIMIZEBTN GUISetState(@SW_MINIMIZE) Case $MenuItems[0] MsgBox(0, "GUI Event","Menu item 1 clicked") _Switch_MenuItem(0) Case $MenuItems[1] MsgBox(0, "GUI Event","Menu item 2 clicked") _Switch_MenuItem(1) Case $MenuItems[2] MsgBox(0, "GUI Event","Menu item 3 clicked") _Switch_MenuItem(2) _HighlightSeletedItem($MenuItems, 2) Case $MenuItems[3] MsgBox(0, "GUI Event","Menu item 4 clicked") _Switch_MenuItem(3) _HighlightSeletedItem($MenuItems, 3) EndSwitch WEnd #Region "FUNCTIONS DEFINITION" ---------------------------------------------------------------- Func _InitContentOnStart() ;#Here I choose to initialize content (on start of the program) with the 1st menu item (value 0) _CreateMenu1Content() _HighlightSeletedItem($MenuItems, 0) $MENU_CURR_INDEX=0 ;Set the current index value to 0 EndFunc Func _HighlightSeletedItem($handles, $selected) For $i=0 To Ubound($handles)-1 GUICtrlSetFont($handles[$i], 10, 400, 0, "Segoe UI") Next GUICtrlSetFont($handles[$selected], 10, 800, 0, "Segoe UI") EndFunc Func _Switch_MenuItem($selected) $MENU_PREV_INDEX=$MENU_CURR_INDEX ;First set the previous index value $MENU_CURR_INDEX=$selected ;Then set the new current index value ;#[1]=> Delete Previous Content Switch $MENU_PREV_INDEX Case "0" ;;0 => MenuItem1 _DeleteMenu1Content() Case "1" ;;1 => MenuItem2 _DeleteMenu2Content() Case "2" ;;2 => MenuItem3 _DeleteMenu3Content() Case "3" ;;3 => MenuItem4 _DeleteMenu4Content() EndSwitch ;#[2]=> Display New Content Switch $MENU_CURR_INDEX Case "0" _HighlightSeletedItem($MenuItems, 0) _CreateMenu1Content() Case "1" _HighlightSeletedItem($MenuItems, 1) _CreateMenu2Content() Case "2" _HighlightSeletedItem($MenuItems, 2) _CreateMenu3Content() Case "3" _HighlightSeletedItem($MenuItems, 3) _CreateMenu4Content() EndSwitch EndFunc ;=> _Switch_MenuItem() Func _CreateMenu1Content() GLOBAL $ScanState = GUICtrlCreateLabel("Specify the location to save the backup (type, browse, or drag path)", $GUI_MENUBKG_WIDTH+15, 40, 430, 23) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, $GUI_TITLES_COLOR) GLOBAL $SavePath = GUICtrlCreateInput("", $GUI_MENUBKG_WIDTH+15, 60, 430, 23) GUICtrlSetState($SavePath, $GUI_DROPACCEPTED) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, $GUI_TITLES_COLOR) GLOBAL $BrowseSavePath = GUICtrlCreateButton("...", $GUI_MENUBKG_WIDTH+450, 60, 20, 23) GLOBAL $UI = GUICtrlCreateLabel("Enter the Username (SSO) you want to backup.", $GUI_MENUBKG_WIDTH+15, 90, 250, 23) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, $GUI_TITLES_COLOR) GLOBAL $Name = GUICtrlCreateInput("", $GUI_MENUBKG_WIDTH+15, 110, 80, 23) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, $GUI_TITLES_COLOR) GLOBAL $MultipleUser = GUICtrlCreateCheckbox("All users logged in within the last 21 days", $GUI_MENUBKG_WIDTH+100, 110, 400, 23) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, $GUI_TITLES_COLOR) GLOBAL $Cancel = GUICtrlCreateButton("Cancel", $GUI_MENUBKG_WIDTH+300, 290, 95, 32) GUICtrlSetColor(-1, 0xffffff) GUICtrlSetState($Cancel, $GUI_HIDE) GLOBAL $ShowTime = GUICtrlCreateLabel("", $GUI_MENUBKG_WIDTH+120, 130, 100, 15, $SS_RIGHT) GLOBAL $ShowSize = GUICtrlCreateLabel("", $GUI_MENUBKG_WIDTH+140, 150, 100, 15, $SS_RIGHT) GLOBAL $ProgressBar = GUICtrlCreateProgress($GUI_MENUBKG_WIDTH+180, 180, 370, 20) GUICtrlSetState($ProgressBar, $GUI_HIDE) GLOBAL $ProgressText = GUICtrlCreateLabel("", $GUI_MENUBKG_WIDTH+200, 203, 100, 15, $SS_RIGHT) GLOBAL $ShowWaitMessage = GUICtrlCreateLabel("Please wait, setting up", $GUI_MENUBKG_WIDTH+220, 200, 110, 15) GUICtrlSetState($ShowWaitMessage, $GUI_HIDE) GLOBAL $ShowWaitMessageDots = GUICtrlCreateLabel($WaitMessageDots, $GUI_MENUBKG_WIDTH+250, 200, 200, 15) GUICtrlSetState($ShowWaitMessageDots, $GUI_HIDE) GLOBAL $ShowCurrentFile = GUICtrlCreateLabel("", $GUI_MENUBKG_WIDTH+10 , 200, 480, 15, $DT_END_ELLIPSIS) GLOBAL $AL = GUICtrlCreateLabel ("Please select the type of backup required.", $GUI_MENUBKG_WIDTH+15, 140, 300, 20) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, $GUI_TITLES_COLOR) GLOBAL $LogicFiles = GUICtrlCreateCombo ("", $GUI_MENUBKG_WIDTH+15, 165, 200, 200) GUICtrlSetData($LogicFiles, "Full Backup|Configuration backup") GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, $GUI_TITLES_COLOR) $Go = GUICtrlCreateButton("Back-Up", $GUI_MENUBKG_WIDTH+400, 290, 95, 32) GUICtrlSetColor(-1, 0xffffff) GUICtrlSetBkColor(-1, $GUI_FONT_COLOR) Local $AccelKeys[1][2] = [["{ENTER}", $Go]] GUISetAccelerators($AccelKeys) While 1 GLOBAL $LogicFile = "" Switch GUICtrlRead($LogicFile) Case "Full Backup" $LogicFile = "config_XML\MigUserCustom.xml" ExitLoop Case "Configuration backup" ; Does not work as of 24/01 $LogicFile = "config_XML\MigUserCustom_VOD.xml" Exitloop EndSwitch WEnd ; Build the Argument Variable If $LastState == 1 And GUICtrlRead($MultipleUser) == 4 Then GUICtrlSetState($Name, $GUI_Enable) EndIf If $LastState == 4 And GUICtrlRead($MultipleUser) == 1 Then GUICtrlSetState($Name, $GUI_DISABLE) EndIf $MSG = GUIGetMsg() While 0 Switch $MSG Case $Go Do $GetName = StringUpper(StringReplace(GUICtrlRead($Name), "", "_")) $GetSavePath = GUICtrlRead($SavePath) If $GetName == "" And GUICtrlRead($MultipleUser) == 4 Then MsgBox(16, "ERROR", "Please enter an SSO to backup OR select the ALL PROFILES option") Else $Date = _NowCalcDate() $DateBreak = StringSplit($Date, "/") $FullSavePath = StringUpper(StringReplace($GetSavePath & "\" & $GetName & $DateBreak[2] & $DateBreak[3] & StringRight($DateBreak[1], 2), "\\", "\")) If StringLeft($FullSavePath, 1) == "\" Then $FullSavePath = "\" & $FullSavePath $Exist = FileExists($FullSavePath) Local $YesOrNo If $Exist Then $YesOrNo = MsgBox(4, "Overwrite?", "The save path specified already exists:" & @CR & $FullSavePath & @CR & @CR & "Overwrite?") If $YesOrNo == 6 Or Not $Exist Then $TempFile = _TempFile($FullSavePath) $TestTempFile = FileOpen($TempFile, 1 + 8) FileClose($TestTempFile) FileDelete($TempFile) If $TestTempFile == -1 Then MsgBox(16, "ERROR", "The path you have specified does not exist or is not writable. Please check the path.") Else $StartTime = TimerInit() GUICtrlDelete($Go) GUICtrlSetState($Cancel, $GUI_SHOW) GUICtrlSetState($SavePath, $GUI_DISABLE) GUICtrlSetState($BrowseSavePath, $GUI_DISABLE) GUICtrlSetState($Name, $GUI_DISABLE) _BuildUSMTCommand($FullSavePath, $GetName) EndIf EndIf EndIf Until True == False Case $BrowseSavePath $Where = FileSelectFolder("Choose the location to save the data", "", 1 + 4) GUICtrlSetData($SavePath, $Where) EndSwitch WEnd EndFunc Func _BuildUSMTCommand($sFullSavePath, $GetName) ; Build the Argument Variable If $LastState == 4 And GUICtrlRead($MultipleUser) == 1 Then $aUG = "/UEL:21 " EndIf If $LastState == 1 And GUICtrlRead($MultipleUser) == 4 Then $aUG = ' /ue:*\* ' & '/ui:"' & $GetName & '"' EndIf GUICtrlSetData($ShowCurrentFile, "Extracting USMT archives") GUICtrlSetState($ShowWaitMessage, $GUI_SHOW) GUICtrlSetState($ShowWaitMessageDots, $GUI_SHOW) $ListFiles = @TempDir & "\listfiles.txt" $ProgFile = @TempDir & "\prog.txt" $LogFile = '"' & $sFullSavePath & '\log.txt"' FileDelete($ListFiles) FileDelete($ProgFile) FileDelete($LogFile) FileInstall("7z.exe", @TempDir & "\7z.exe", 1) FileInstall("7z.dll", @TempDir & "\7z.dll", 1) If @OSArch == "X86" Then $Inst = FileInstall("x86.7z", @TempDir & "\x86.7z", 1) RunWait(@TempDir & '\7z.exe x "' & @TempDir & '\x86.7z" -o"' & @TempDir & '\USMT5" -y', @TempDir, @SW_SHOW) Else $Inst = FileInstall("amd64.7z", @TempDir & "\amd64.7z", 1) RunWait(@TempDir & '\7z.exe x "' & @TempDir & '\amd64.7z" -o"' & @TempDir & '\USMT5" -y', @TempDir, @SW_Show) EndIf ConsoleWrite("inst -> " & $Inst & @CR) $Arguments = '"' & $sFullSavePath & '"' & ' /o /c ' & $aUG & ' /i:' & @TempDir & '\USMT5\' & $logicFile & ' /l:' & $LogFile & ' /progress:"' & $ProgFile & '" /listfiles:"' & $ListFiles & '"' GUICtrlSetData($ShowCurrentFile, "Examining Data") ShellExecuteWait(@TempDir & "\USMT5\scanstate.exe", $Arguments, $sFullSavePath, "open", @SW_show) ShellExecute("notepad.exe", $LogFile, @TempDir, "open", @SW_SHOW) Sleep(5000) Send("^{END}") MsgBox(64, "Done", "USMT has finished. Please review the end of the log and confirm that the backup finished with no errors.") Exit EndFunc ;==>_BuildUSMTCommand Func _PlayWithWaitMessage() If GUICtrlRead($Cancel) == 1 Then $YesOrNo = MsgBox(4, "Quit?", "Do you really want to quit?") If $YesOrNo == 6 Then Do Sleep(10) ProcessClose("scanstate.exe") Until Not ProcessExists("scanstate.exe") Exit EndIf GUICtrlSetState($Cancel, $GUI_UNCHECKED) EndIf GUICtrlSetData($ShowTime, _NiceTime(TimerDiff($StartTime) / 1000)) If $WaitIncrease == True Then $WaitMessageDots &= "." Else $WaitMessageDots = StringTrimRight($WaitMessageDots, 1) EndIf GUICtrlSetData($ShowWaitMessageDots, $WaitMessageDots) If StringLen($WaitMessageDots) < 1 Then $WaitIncrease = True If StringLen($WaitMessageDots) > 30 Then $WaitIncrease = False If $FoundSize == False Then $OpenProg = FileOpen($ProgFile, 0) Do $Line = FileReadLine($OpenProg) If @error Then ExitLoop If StringInStr($Line, "totalPercentageCompleted") Then FileClose($OpenProg) AdlibUnRegister("_PlayWithWaitMessage") AdlibRegister("_Progress", 500) FileClose($OpenProg) $OpenProg = FileOpen($ProgFile, 0) Do $Line = FileReadLine($OpenProg) If @error Then ExitLoop If StringInStr($Line, "totalSizeInMBToTransfer") Then $Break = StringSplit($Line, ",") GUICtrlSetData($ShowSize, _ByteSuffix($Break[5])) GUICtrlDelete($ShowWaitMessage) GUICtrlDelete($ShowWaitMessageDots) GUICtrlSetState($ProgressBar, $GUI_SHOW) $FoundSize = True $StartTime = TimerInit() FileClose($OpenProg) EndIf Until True == False EndIf Until True == False FileClose($OpenProg) EndIf EndFunc ;==>_PlayWithWaitMessage Func _Progress() If GUICtrlRead($Cancel) == 1 Then $YesOrNo = MsgBox(4, "Quit?", "Do you really want to quit?") If $YesOrNo == 6 Then Do Sleep(10) ProcessClose("scanstate.exe") Until Not ProcessExists("scanstate.exe") Do Sleep(10) ProcessClose("streams.exe") Until Not ProcessExists("streams.exe") Exit EndIf GUICtrlSetState($Cancel, $GUI_UNCHECKED) EndIf GUICtrlSetData($ShowTime, _NiceTime(TimerDiff($StartTime) / 1000)) $OpenProg = FileOpen($ProgFile, 0) $Line = FileReadLine($OpenProg, -1) FileClose($OpenProg) $BreakProg = StringSplit($Line, ", ", 1) If $BreakProg[1] > 4 Then If $BreakProg[5] == "Saving" Then GUICtrlSetData($ProgressBar, 100) GUICtrlSetData($ProgressText, "100%") GUICtrlDelete($Cancel) Else GUICtrlSetData($ProgressBar, $BreakProg[5]) GUICtrlSetData($ProgressText, $BreakProg[5] & "%") EndIf EndIf $LastFile = $CurrentFile $Count = _FileCountLines($ListFiles) $OpenList = FileOpen($ListFiles, 0) $CurrentFile = FileReadLine($OpenList, $Count) FileClose($OpenList) If $LastFile <> $CurrentFile Then GUICtrlSetData($ShowCurrentFile, StringTrimLeft($CurrentFile, 3)) EndFunc ;==>_Progress Func _NiceTime($iSecs) Return StringFormat('%02i:%02i:%02i', Floor($iSecs / 3600), Floor(Mod($iSecs, 3600) / 60), Mod($iSecs, 60)) EndFunc ;==>_NiceTime Func _ByteSuffix($Bytes) Local $BytesSuffix[4] = [" MB", " GB", " TB", " PB"] $x = 0 While $Bytes > 1023 $x += 1 $Bytes /= 1024 WEnd Return StringFormat('%.2f', $Bytes) & $BytesSuffix[$x] EndFunc ;==>_ByteSuffix Func _RunStreams($rsFullSavePath, $rsWorkingOffline, $rsGetOfflinePath) If $rsWorkingOffline == True Then $rsDrive = StringLeft($rsGetOfflinePath, 1) Else $rsDrive = StringLeft(@WindowsDir, 1) EndIf $rsExclusions = StringSplit("application data|local settings|userdata|appdata", "|") $rsDocsFolder = $rsDrive & ":\documents and settings" For $a = 1 To 2 $GetUserDirs = FileFindFirstFile($rsDocsFolder & "\*.*") Do $User = FileFindNextFile($GetUserDirs) If @error Then ExitLoop If StringInStr(FileGetAttrib($rsDocsFolder & "\" & $User), "D") Then GUICtrlSetData($ShowCurrentFile, 'Setting files in ' & $rsDocsFolder & '\' & $User & ' to "unblocked"') ShellExecuteWait(@TempDir & "\streams.exe", "-d " & $rsDocsFolder & "\" & $User, @TempDir, "open", @SW_HIDE) $GetDocDirs = FileFindFirstFile($rsDocsFolder & "\" & $User & "\*.*") Do $FoundFolders = FileFindNextFile($GetDocDirs) If @error Then ExitLoop If StringInStr(FileGetAttrib($rsDocsFolder & "\" & $User & "\" & $FoundFolders), "D") Then $CanRunStream = True For $b = 1 To $rsExclusions[0] If StringLower($FoundFolders) == $rsExclusions[$b] Then $CanRunStream = False Next If $CanRunStream == True Then GUICtrlSetData($ShowCurrentFile, 'Setting files in ' & $rsDocsFolder & '\' & $User & '\' & $FoundFolders & ' to "unblocked"') ShellExecuteWait(@TempDir & "\streams.exe", "-s -d " & $rsDocsFolder & "\" & $User & "\" & $FoundFolders, @TempDir, "open", @SW_HIDE) EndIf EndIf Until True == False EndIf Until True == False $rsDocsFolder = $rsDrive & ":\users" Next EndFunc ;==>_RunStreams Func _DeleteMenu1Content() ;#[1]=> Delete all the stuff we created for the menu item 1 GUICtrlDelete($ScanState) GUICtrlDelete($SavePath) GUICtrlDelete($Name) GUICtrlDelete($MultipleUser) GUICtrlDelete($UI) GUICtrlDelete($LogicFiles) GUICtrlDelete($AL) GUICtrlDelete($BrowseSavePath) EndFunc ;=> _CreateSampleContent() Func _CreateMenu2Content() ;#[1]=> Create Titles (using a default data/text) GLOBAL $Menu2Title = GUICtrlCreateLabel("The new content:", $GUI_MENUBKG_WIDTH+35, 80, 110+8, 23) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, $GUI_TITLES_COLOR) ;#[2]=> Create Labels (using a default data/text) GLOBAL $Menu2Label1 = GUICtrlCreateLabel("Content for item2", ($GUI_MENUBKG_WIDTH+35)+125, 80, 251, 23) GUICtrlSetFont(-1, 10, 700, 0, "Segoe UI Semibold") GUICtrlSetColor(-1, $GUI_FONT_COLOR) GLOBAL $Menu2Label2 = GUICtrlCreateLabel("The content changed, click again!", ($GUI_MENUBKG_WIDTH+35)+35, 144, 251, 23) GUICtrlSetFont(-1, 10, 700, 0, "Segoe UI Semibold") GUICtrlSetColor(-1, $GUI_FONT_COLOR) EndFunc ;=> _CreateSampleContent() Func _DeleteMenu2Content() ;#[1]=> Delete all the stuff we created for the menu item 1 GUICtrlDelete($Menu2Title) GUICtrlDelete($Menu2Label1) GUICtrlDelete($Menu2Label2) EndFunc ;=> _CreateSampleContent() Func _CreateMenu3Content() ;#[1]=> Create Buttons GLOBAL $Menu3Button1 = GUICtrlCreateButton("Click", ($GUI_MENUBKG_WIDTH+35)+65, 250, 95, 32) GUICtrlSetColor(-1, 0xffffff) GUICtrlSetBkColor(-1, $GUI_FONT_COLOR) GLOBAL $Menu3Button2 = GUICtrlCreateButton("Again", ($GUI_MENUBKG_WIDTH+35)+170, 250, 95, 32) GUICtrlSetColor(-1, 0xffffff) GUICtrlSetBkColor(-1, $GUI_FONT_COLOR) EndFunc ;=> _CreateSampleContent() Func _DeleteMenu3Content() ;#[1]=> Delete all the stuff we created for the menu item 1 GUICtrlDelete($Menu3Button1) GUICtrlDelete($Menu3Button2) EndFunc ;=> _CreateSampleContent() Func _CreateMenu4Content() ;#[1]=> Create Titles (using a default data/text) GLOBAL $Menu4Title = GUICtrlCreateLabel("Menu Item 4:", $GUI_MENUBKG_WIDTH+35, 80, 110+8, 23) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, $GUI_TITLES_COLOR) ;#[2]=> Create Labels (using a default data/text) GLOBAL $Menu4Label1 = GUICtrlCreateLabel("Content for item4", ($GUI_MENUBKG_WIDTH+35)+125, 80, 251, 23) GUICtrlSetFont(-1, 10, 700, 0, "Segoe UI Semibold") GUICtrlSetColor(-1, $GUI_FONT_COLOR) EndFunc ;=> _CreateSampleContent() Func _DeleteMenu4Content() ;#[1]=> Delete all the stuff we created for the menu item 1 GUICtrlDelete($Menu4Title) GUICtrlDelete($Menu4Label1) EndFunc ;=> _CreateSampleContent() #EndRegion "FUNCTIONS DEFINITION" -------------------------------------------------------------