Что нового

Некорректно отображается содержимое вкладок GUI

Detre

Новичок
Сообщения
70
Репутация
0
Всем доброй ночи. Очень нужна помощь.При переключении запуске скрипта,отображается содержимое вкладок Mode 1 и Mode 2 одновременно, хотя функции разные.При переключении на Mode 2 и обратно на Mode 1, все становится правильно. Заранее извиняюсь за такой нагромажденный скрипт.
Код:
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
#include <String.au3>
#include <Crypt.au3>
#include <WinAPISysWin.au3>
#include <FileConstants.au3>
#RequireAdmin
#NoTrayIcon

Opt("GUIOnEventMode", 1)

Global $Assets = @ScriptDir & "\Assets\"
Global $cUI_BK = 0x02101B
Global $cContent_BK = 0x091926
Global $cText = 0xDEDEDE
Global $cTextA = 0x56CBDD
Global $cCardBk = 0x0C1C29
Global $lastMenu = Default
Global $isOnTop = False
Global $ui_w = 800
Global $ui_h = 520
Global $topPanel_h = CalcPercent(12, $ui_h)
Global $bottomPanel_h = CalcPercent(8, $ui_h)
Global $bottomPanel_y = $ui_h - $bottomPanel_h
Global $leftPanel_w = CalcPercent(25, $ui_w)
Global $contentPanel_x = $leftPanel_w
Global $contentPanel_y = $topPanel_h
Global $contentPanel_w = $ui_w - $leftPanel_w
Global $contentPanel_h = $ui_h - ($topPanel_h + $bottomPanel_h)


Global $UI = GUICreate("Experience UI", $ui_w, $ui_h) ; $WS_POPUP, $WS_EX_CONTROLPARENT
WinSetTrans($UI, "", 0);
GUISetState(@SW_SHOW, $UI)
For $i = 0 To 243 Step 2
    WinSetTrans($UI, "", $i);Прозрачность 0-255

Next

GUISetOnEvent(-3, "Terminate", $UI)
GUISetBkColor($cUI_BK, $UI)

Global $topPanel = GUICtrlCreateLabel("", 0, 0, $ui_w, $topPanel_h) ; height = 12% from UI | (ps. $GUI_WS_EX_PARENTDRAG)
GUICtrlSetState($topPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($topPanel, $cUI_BK)

Global $bottomPanel = GUICtrlCreateLabel("", 0, $bottomPanel_y, $ui_w, $bottomPanel_h)
GUICtrlSetState($bottomPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($bottomPanel, $cUI_BK)

Global $leftPanel = GUICtrlCreateLabel("", 0, $topPanel_h, $leftPanel_w, $ui_h - ($topPanel_h + $bottomPanel_h))
GUICtrlSetState($leftPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($leftPanel, $cUI_BK)

Global $contentPanel = GUICtrlCreateLabel("", $contentPanel_x, $contentPanel_y, $contentPanel_w, $contentPanel_h)
GUICtrlSetState($contentPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($contentPanel, $cContent_BK)

$y = $bottomPanel_y + (($bottomPanel_h / 2) - (28 / 2))
GUICtrlCreateLabel("© 2020 by DiJo.", 10, $y, $leftPanel_w - 38, 28, 0x0200)
GUICtrlSetFont(-1, 8, Default, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)

Global $y = $topPanel_h
GUICtrlCreateLabel(" FNKC Pack", 52, $y, $leftPanel_w - 52, 32, 0x0200)
GUICtrlSetFont(-1, 12, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)

$y += 50
Global $vDashboard = GUICtrlCreateLabel("Mode 1", 38, $y, $leftPanel_w - 38, 32, 0x0200)
GUICtrlSetOnEvent(-1, "Mode_1")
GUICtrlSetFont(-1, 11, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cTextA)
GUICtrlSetCursor(-1, 0)
$lastMenu = $vDashboard
$y += 32
Global $vWallet = GUICtrlCreateLabel("Mode 2", 38, $y, $leftPanel_w - 38, 32, 0x0200)
GUICtrlSetOnEvent(-1, "Mode_2")
GUICtrlSetFont(-1, 11, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)
GUICtrlSetCursor(-1, 0)
$y += 32
Global $vMessages = GUICtrlCreateLabel("Mode 3", 38, $y, $leftPanel_w - 38, 32, 0x0200)
GUICtrlSetOnEvent(-1, "Mode_3")
GUICtrlSetFont(-1, 11, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)
GUICtrlSetCursor(-1, 0)

$y = ($topPanel_h + 50)
Global $vIndicator = GUICtrlCreateLabel("", 0, $y, 4, 32)
GUICtrlSetBkColor(-1, $cTextA)


$x = $contentPanel_x + 10
$y = $contentPanel_y + 15
Global $iHostName = GUICtrlCreateInput("HOST", 412, 90, 180, 21, $ES_CENTER)
Global $Button1 = GUICtrlCreateButton("Ping", $x, $y + 80, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button1")
Global $Button2 = GUICtrlCreateButton("ChangePass", $x + 310, $y + 80, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button2")
GUISetState() ; Show GUI
Global $Button3 = GUICtrlCreateButton("Logus", $x, $y + 140, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button3")
GUISetState() ; Show GUI
Global $Button4 = GUICtrlCreateButton("Microb KDL", $x + 310, $y + 140, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button4")
GUISetState() ; Show GUI
Global $Button5 = GUICtrlCreateButton("Net Aact_64", $x, $y + 200, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button5")
GUISetState() ; Show GUI
Global $Button6 = GUICtrlCreateButton("Net Aact_86", $x + 310, $y + 200, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button6")
GUISetState() ; Show GUI
Global $Button7 = GUICtrlCreateButton("Net Aact_64_GVLK", $x , $y + 260, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button7")
GUISetState() ; Show GUI
Global $Button8 = GUICtrlCreateButton("Net Aact_86_GVLK", $x + 310, $y + 260, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button8")
GUISetState() ; Show GUI
Global $Button9 = GUICtrlCreateButton("CCSP", $x ,$y + 320, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button9")
GUISetState() ; Show GUI
Global $Button10 = GUICtrlCreateButton("DameWare", $x + 310, $y + 320, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button10")
GUISetState() ; Show GUI)
GUISetState(@SW_SHOW, $UI)
Global $Button11 = GUICtrlCreateButton("Start", $x + 150, $y + 40, 73, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button11")
GUISetState() ; Show GUI)
Global $Button12 = GUICtrlCreateButton("x64", $x + 230, $y + 40, 53, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button12")
GUISetState() ; Show GUI)
Global $Button13 = GUICtrlCreateButton("x86", $x + 295, $y + 40, 53, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button13")
GUISetState() ; Show GUI)
Global $Button14 = GUICtrlCreateButton("Reboot", $x + 355, $y + 40, 73, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button14")
GUISetState() ; Show GUI)
Global $Button15 = GUICtrlCreateButton("Chrome", $x, $y + 80, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button15")

Global $Checkbox1 = GUICtrlCreateCheckbox("", $x+ 273, $y + 95, 12, 12)
Global $Checkbox2 = GUICtrlCreateCheckbox("", $x+ 293, $y + 95, 12, 12)
Global $Checkbox3 = GUICtrlCreateCheckbox("", $x+ 273, $y + 155, 12, 12)
Global $Checkbox4 = GUICtrlCreateCheckbox("", $x+ 293, $y + 155, 12, 12)
Global $Checkbox5 = GUICtrlCreateCheckbox("", $x+ 273, $y + 215, 12, 12)
Global $Checkbox6 = GUICtrlCreateCheckbox("", $x+ 293, $y + 215, 12, 12)
Global $Checkbox7 = GUICtrlCreateCheckbox("", $x+ 273, $y + 275, 12, 12)
Global $Checkbox8 = GUICtrlCreateCheckbox("", $x+ 293, $y + 275, 12, 12)
Global $Checkbox9 = GUICtrlCreateCheckbox("", $x+ 273, $y + 335, 12, 12)
Global $Checkbox10 = GUICtrlCreateCheckbox("", $x+ 293, $y + 335, 12, 12)
GUISetState() ; Show GUI
Local $rHostName
While True
    Sleep(10)
WEnd

Func Mode_1()
    If $lastMenu <> $vDashboard Then
        Local $CGP = ControlGetPos($UI, '', $vDashboard)
        GUICtrlSetPos($vIndicator, 0, $CGP[1])
        GUICtrlSetColor($vDashboard, $cTextA)
        GUICtrlSetColor($lastMenu, $cText)
        $lastMenu = $vDashboard
        GUICtrlSetState($Button1, $GUI_HIDE)
		GUICtrlSetState($Button2, $GUI_HIDE)
		GUICtrlSetState($Button3, $GUI_HIDE)
		GUICtrlSetState($Button4, $GUI_HIDE)
		GUICtrlSetState($Button5, $GUI_HIDE)
		GUICtrlSetState($Button6, $GUI_HIDE)
		GUICtrlSetState($Button7, $GUI_HIDE)
		GUICtrlSetState($Button8, $GUI_HIDE)
		GUICtrlSetState($Button9, $GUI_HIDE)
		GUICtrlSetState($Button10, $GUI_HIDE)
		GUICtrlSetState($Button11, $GUI_HIDE)
		GUICtrlSetState($Button12, $GUI_HIDE)
		GUICtrlSetState($Button13, $GUI_HIDE)
		GUICtrlSetState($Button14, $GUI_HIDE)
		GUICtrlSetState($Button15, $GUI_SHOW)
		GUICtrlSetState($Checkbox1, $GUI_HIDE)
		GUICtrlSetState($Checkbox2, $GUI_HIDE)
		GUICtrlSetState($Checkbox3, $GUI_HIDE)
		GUICtrlSetState($Checkbox4, $GUI_HIDE)
		GUICtrlSetState($Checkbox5, $GUI_HIDE)
		GUICtrlSetState($Checkbox6, $GUI_HIDE)
		GUICtrlSetState($Checkbox7, $GUI_HIDE)
		GUICtrlSetState($Checkbox8, $GUI_HIDE)
		GUICtrlSetState($Checkbox9, $GUI_HIDE)
		GUICtrlSetState($Checkbox10, $GUI_HIDE)
		ConsoleWrite(1)
    EndIf
EndFunc   ;==>DashboardEvent

Func Mode_2()
    If $lastMenu <> $vWallet Then
        Local $CGP = ControlGetPos($UI, '', $vWallet)
        GUICtrlSetPos($vIndicator, 0, $CGP[1])
        GUICtrlSetColor($vWallet, $cTextA)
        GUICtrlSetColor($lastMenu, $cText)
        $lastMenu = $vWallet
	    GUICtrlSetState($Button1, $GUI_SHOW)
		GUICtrlSetState($Button2, $GUI_SHOW)
		GUICtrlSetState($Button3, $GUI_SHOW)
		GUICtrlSetState($Button4, $GUI_SHOW)
		GUICtrlSetState($Button5, $GUI_SHOW)
		GUICtrlSetState($Button6, $GUI_SHOW)
		GUICtrlSetState($Button7, $GUI_SHOW)
		GUICtrlSetState($Button8, $GUI_SHOW)
		GUICtrlSetState($Button9, $GUI_SHOW)
		GUICtrlSetState($Button10, $GUI_SHOW)
		GUICtrlSetState($Button11, $GUI_SHOW)
		GUICtrlSetState($Button12, $GUI_SHOW)
		GUICtrlSetState($Button13, $GUI_SHOW)
		GUICtrlSetState($Button14, $GUI_SHOW)
        GUICtrlSetState($Button15, $GUI_HIDE)
		GUICtrlSetState($Checkbox1, $GUI_SHOW)
		GUICtrlSetState($Checkbox2, $GUI_SHOW)
		GUICtrlSetState($Checkbox3, $GUI_SHOW)
		GUICtrlSetState($Checkbox4, $GUI_SHOW)
		GUICtrlSetState($Checkbox5, $GUI_SHOW)
		GUICtrlSetState($Checkbox6, $GUI_SHOW)
		GUICtrlSetState($Checkbox7, $GUI_SHOW)
		GUICtrlSetState($Checkbox8, $GUI_SHOW)
		GUICtrlSetState($Checkbox9, $GUI_SHOW)
		GUICtrlSetState($Checkbox10, $GUI_SHOW)
		ConsoleWrite(1)
		ConsoleWrite(1)
    EndIf
EndFunc   ;==>WalletEvent

Func Mode_3()
    If $lastMenu <> $vMessages Then
        Local $CGP = ControlGetPos($UI, '', $vMessages)
        GUICtrlSetPos($vIndicator, 0, $CGP[1])
        GUICtrlSetColor($vMessages, $cTextA)
        GUICtrlSetColor($lastMenu, $cText)
        $lastMenu = $vMessages
        GUICtrlSetState($Button1, $GUI_HIDE)
		GUICtrlSetState($Button2, $GUI_HIDE)
		GUICtrlSetState($Button3, $GUI_HIDE)
		GUICtrlSetState($Button4, $GUI_HIDE)
		GUICtrlSetState($Button5, $GUI_HIDE)
		GUICtrlSetState($Button6, $GUI_HIDE)
		GUICtrlSetState($Button7, $GUI_HIDE)
		GUICtrlSetState($Button8, $GUI_HIDE)
		GUICtrlSetState($Button9, $GUI_HIDE)
		GUICtrlSetState($Button10, $GUI_HIDE)
		GUICtrlSetState($Button11, $GUI_HIDE)
		GUICtrlSetState($Button12, $GUI_HIDE)
		GUICtrlSetState($Button13, $GUI_HIDE)
		GUICtrlSetState($Button14, $GUI_HIDE)
		GUICtrlSetState($Button15, $GUI_HIDE)
		GUICtrlSetState($Checkbox1, $GUI_HIDE)
		GUICtrlSetState($Checkbox2, $GUI_HIDE)
		GUICtrlSetState($Checkbox3, $GUI_HIDE)
		GUICtrlSetState($Checkbox4, $GUI_HIDE)
		GUICtrlSetState($Checkbox5, $GUI_HIDE)
		GUICtrlSetState($Checkbox6, $GUI_HIDE)
		GUICtrlSetState($Checkbox7, $GUI_HIDE)
		GUICtrlSetState($Checkbox8, $GUI_HIDE)
		GUICtrlSetState($Checkbox9, $GUI_HIDE)
		GUICtrlSetState($Checkbox10, $GUI_HIDE)
		ConsoleWrite(1)
    EndIf
EndFunc   ;==>MessagesEvent

Func Terminate()
    GUIDelete($UI)
    Exit
EndFunc   ;==>Terminate

Func Minimize()
    GUISetState(@SW_MINIMIZE, $UI)
EndFunc   ;==>Minimize


Func Topmost()
    If $isOnTop = False Then
        WinSetOnTop($UI, Default, 1)
        $isOnTop = True
    Else
        WinSetOnTop($UI, Default, 0)
        $isOnTop = False
    EndIf
EndFunc   ;==>Topmost

Func CalcPercent($vPercent, $vInt) ; Calculate percent % :)
    Return $vPercent * $vInt / 100
EndFunc   ;==>CalcPercent
 

ra4o

AutoIT Гуру
Сообщения
1,165
Репутация
247
у Вас отображается содержимое всех вкладок так , как Вы их создаёте видимыми , и никакие функции изначально не вызываются . Можно сделать так :
Эту строку исправьте в таком виде : $lastMenu =''
и ПЕРЕД бесконечным циклом (ВНЕ ЦИКЛА) вызовите функцию Mode_1()
Код:
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
#include <String.au3>
#include <Crypt.au3>
#include <WinAPISysWin.au3>
#include <FileConstants.au3>
#RequireAdmin
#NoTrayIcon

Opt("GUIOnEventMode", 1)

Global $Assets = @ScriptDir & "\Assets\"
Global $cUI_BK = 0x02101B
Global $cContent_BK = 0x091926
Global $cText = 0xDEDEDE
Global $cTextA = 0x56CBDD
Global $cCardBk = 0x0C1C29
Global $lastMenu = Default
Global $isOnTop = False
Global $ui_w = 800
Global $ui_h = 520
Global $topPanel_h = CalcPercent(12, $ui_h)
Global $bottomPanel_h = CalcPercent(8, $ui_h)
Global $bottomPanel_y = $ui_h - $bottomPanel_h
Global $leftPanel_w = CalcPercent(25, $ui_w)
Global $contentPanel_x = $leftPanel_w
Global $contentPanel_y = $topPanel_h
Global $contentPanel_w = $ui_w - $leftPanel_w
Global $contentPanel_h = $ui_h - ($topPanel_h + $bottomPanel_h)


Global $UI = GUICreate("Experience UI", $ui_w, $ui_h) ; $WS_POPUP, $WS_EX_CONTROLPARENT
WinSetTrans($UI, "", 0) ;
GUISetState(@SW_SHOW, $UI)
For $i = 0 To 243 Step 2
    WinSetTrans($UI, "", $i) ;Прозрачность 0-255

Next

GUISetOnEvent(-3, "Terminate", $UI)
GUISetBkColor($cUI_BK, $UI)

Global $topPanel = GUICtrlCreateLabel("", 0, 0, $ui_w, $topPanel_h) ; height = 12% from UI | (ps. $GUI_WS_EX_PARENTDRAG)
GUICtrlSetState($topPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($topPanel, $cUI_BK)

Global $bottomPanel = GUICtrlCreateLabel("", 0, $bottomPanel_y, $ui_w, $bottomPanel_h)
GUICtrlSetState($bottomPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($bottomPanel, $cUI_BK)

Global $leftPanel = GUICtrlCreateLabel("", 0, $topPanel_h, $leftPanel_w, $ui_h - ($topPanel_h + $bottomPanel_h))
GUICtrlSetState($leftPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($leftPanel, $cUI_BK)

Global $contentPanel = GUICtrlCreateLabel("", $contentPanel_x, $contentPanel_y, $contentPanel_w, $contentPanel_h)
GUICtrlSetState($contentPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($contentPanel, $cContent_BK)

$y = $bottomPanel_y + (($bottomPanel_h / 2) - (28 / 2))
GUICtrlCreateLabel("© 2020 by DiJo.", 10, $y, $leftPanel_w - 38, 28, 0x0200)
GUICtrlSetFont(-1, 8, Default, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)

Global $y = $topPanel_h
GUICtrlCreateLabel(" FNKC Pack", 52, $y, $leftPanel_w - 52, 32, 0x0200)
GUICtrlSetFont(-1, 12, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)

$y += 50
Global $vDashboard = GUICtrlCreateLabel("Mode 1", 38, $y, $leftPanel_w - 38, 32, 0x0200)
GUICtrlSetOnEvent(-1, "Mode_1")
GUICtrlSetFont(-1, 11, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cTextA)
GUICtrlSetCursor(-1, 0)
$lastMenu =''; $vDashboard
$y += 32
Global $vWallet = GUICtrlCreateLabel("Mode 2", 38, $y, $leftPanel_w - 38, 32, 0x0200)
GUICtrlSetOnEvent(-1, "Mode_2")
GUICtrlSetFont(-1, 11, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)
GUICtrlSetCursor(-1, 0)
$y += 32
Global $vMessages = GUICtrlCreateLabel("Mode 3", 38, $y, $leftPanel_w - 38, 32, 0x0200)
GUICtrlSetOnEvent(-1, "Mode_3")
GUICtrlSetFont(-1, 11, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)
GUICtrlSetCursor(-1, 0)

$y = ($topPanel_h + 50)
Global $vIndicator = GUICtrlCreateLabel("", 0, $y, 4, 32)
GUICtrlSetBkColor(-1, $cTextA)


$x = $contentPanel_x + 10
$y = $contentPanel_y + 15
Global $iHostName = GUICtrlCreateInput("HOST", 412, 90, 180, 21, $ES_CENTER)
Global $Button1 = GUICtrlCreateButton("Ping", $x, $y + 80, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button1")
Global $Button2 = GUICtrlCreateButton("ChangePass", $x + 310, $y + 80, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button2")
GUISetState() ; Show GUI
Global $Button3 = GUICtrlCreateButton("Logus", $x, $y + 140, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button3")
GUISetState() ; Show GUI
Global $Button4 = GUICtrlCreateButton("Microb KDL", $x + 310, $y + 140, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button4")
GUISetState() ; Show GUI
Global $Button5 = GUICtrlCreateButton("Net Aact_64", $x, $y + 200, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button5")
GUISetState() ; Show GUI
Global $Button6 = GUICtrlCreateButton("Net Aact_86", $x + 310, $y + 200, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button6")
GUISetState() ; Show GUI
Global $Button7 = GUICtrlCreateButton("Net Aact_64_GVLK", $x, $y + 260, 267, 43)  ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button7")
GUISetState() ; Show GUI
Global $Button8 = GUICtrlCreateButton("Net Aact_86_GVLK", $x + 310, $y + 260, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button8")
GUISetState() ; Show GUI
Global $Button9 = GUICtrlCreateButton("CCSP", $x, $y + 320, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button9")
GUISetState() ; Show GUI
Global $Button10 = GUICtrlCreateButton("DameWare", $x + 310, $y + 320, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button10")
GUISetState() ; Show GUI)
GUISetState(@SW_SHOW, $UI)
Global $Button11 = GUICtrlCreateButton("Start", $x + 150, $y + 40, 73, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button11")
GUISetState() ; Show GUI)
Global $Button12 = GUICtrlCreateButton("x64", $x + 230, $y + 40, 53, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button12")
GUISetState() ; Show GUI)
Global $Button13 = GUICtrlCreateButton("x86", $x + 295, $y + 40, 53, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button13")
GUISetState() ; Show GUI)
Global $Button14 = GUICtrlCreateButton("Reboot", $x + 355, $y + 40, 73, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button14")
GUISetState() ; Show GUI)
Global $Button15 = GUICtrlCreateButton("Chrome", $x, $y + 80, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button15")

Global $Checkbox1 = GUICtrlCreateCheckbox("", $x + 273, $y + 95, 12, 12)
Global $Checkbox2 = GUICtrlCreateCheckbox("", $x + 293, $y + 95, 12, 12)
Global $Checkbox3 = GUICtrlCreateCheckbox("", $x + 273, $y + 155, 12, 12)
Global $Checkbox4 = GUICtrlCreateCheckbox("", $x + 293, $y + 155, 12, 12)
Global $Checkbox5 = GUICtrlCreateCheckbox("", $x + 273, $y + 215, 12, 12)
Global $Checkbox6 = GUICtrlCreateCheckbox("", $x + 293, $y + 215, 12, 12)
Global $Checkbox7 = GUICtrlCreateCheckbox("", $x + 273, $y + 275, 12, 12)
Global $Checkbox8 = GUICtrlCreateCheckbox("", $x + 293, $y + 275, 12, 12)
Global $Checkbox9 = GUICtrlCreateCheckbox("", $x + 273, $y + 335, 12, 12)
Global $Checkbox10 = GUICtrlCreateCheckbox("", $x + 293, $y + 335, 12, 12)
Mode_1()
GUISetState() ; Show GUI
Local $rHostName


While True
    Sleep(10)
WEnd

Func Mode_1()
    If $lastMenu <> $vDashboard Then
        Local $CGP = ControlGetPos($UI, '', $vDashboard)
        GUICtrlSetPos($vIndicator, 0, $CGP[1])
        GUICtrlSetColor($vDashboard, $cTextA)
        GUICtrlSetColor($lastMenu, $cText)
        $lastMenu = $vDashboard
        GUICtrlSetState($Button1, $GUI_HIDE)
        GUICtrlSetState($Button2, $GUI_HIDE)
        GUICtrlSetState($Button3, $GUI_HIDE)
        GUICtrlSetState($Button4, $GUI_HIDE)
        GUICtrlSetState($Button5, $GUI_HIDE)
        GUICtrlSetState($Button6, $GUI_HIDE)
        GUICtrlSetState($Button7, $GUI_HIDE)
        GUICtrlSetState($Button8, $GUI_HIDE)
        GUICtrlSetState($Button9, $GUI_HIDE)
        GUICtrlSetState($Button10, $GUI_HIDE)
        GUICtrlSetState($Button11, $GUI_HIDE)
        GUICtrlSetState($Button12, $GUI_HIDE)
        GUICtrlSetState($Button13, $GUI_HIDE)
        GUICtrlSetState($Button14, $GUI_HIDE)
        GUICtrlSetState($Button15, $GUI_SHOW)
        GUICtrlSetState($Checkbox1, $GUI_HIDE)
        GUICtrlSetState($Checkbox2, $GUI_HIDE)
        GUICtrlSetState($Checkbox3, $GUI_HIDE)
        GUICtrlSetState($Checkbox4, $GUI_HIDE)
        GUICtrlSetState($Checkbox5, $GUI_HIDE)
        GUICtrlSetState($Checkbox6, $GUI_HIDE)
        GUICtrlSetState($Checkbox7, $GUI_HIDE)
        GUICtrlSetState($Checkbox8, $GUI_HIDE)
        GUICtrlSetState($Checkbox9, $GUI_HIDE)
        GUICtrlSetState($Checkbox10, $GUI_HIDE)
        ConsoleWrite(1)
    EndIf
EndFunc   ;==>Mode_1

Func Mode_2()
    If $lastMenu <> $vWallet Then
        Local $CGP = ControlGetPos($UI, '', $vWallet)
        GUICtrlSetPos($vIndicator, 0, $CGP[1])
        GUICtrlSetColor($vWallet, $cTextA)
        GUICtrlSetColor($lastMenu, $cText)
        $lastMenu = $vWallet
        GUICtrlSetState($Button1, $GUI_SHOW)
        GUICtrlSetState($Button2, $GUI_SHOW)
        GUICtrlSetState($Button3, $GUI_SHOW)
        GUICtrlSetState($Button4, $GUI_SHOW)
        GUICtrlSetState($Button5, $GUI_SHOW)
        GUICtrlSetState($Button6, $GUI_SHOW)
        GUICtrlSetState($Button7, $GUI_SHOW)
        GUICtrlSetState($Button8, $GUI_SHOW)
        GUICtrlSetState($Button9, $GUI_SHOW)
        GUICtrlSetState($Button10, $GUI_SHOW)
        GUICtrlSetState($Button11, $GUI_SHOW)
        GUICtrlSetState($Button12, $GUI_SHOW)
        GUICtrlSetState($Button13, $GUI_SHOW)
        GUICtrlSetState($Button14, $GUI_SHOW)
        GUICtrlSetState($Button15, $GUI_HIDE)
        GUICtrlSetState($Checkbox1, $GUI_SHOW)
        GUICtrlSetState($Checkbox2, $GUI_SHOW)
        GUICtrlSetState($Checkbox3, $GUI_SHOW)
        GUICtrlSetState($Checkbox4, $GUI_SHOW)
        GUICtrlSetState($Checkbox5, $GUI_SHOW)
        GUICtrlSetState($Checkbox6, $GUI_SHOW)
        GUICtrlSetState($Checkbox7, $GUI_SHOW)
        GUICtrlSetState($Checkbox8, $GUI_SHOW)
        GUICtrlSetState($Checkbox9, $GUI_SHOW)
        GUICtrlSetState($Checkbox10, $GUI_SHOW)
        ConsoleWrite(1)
        ConsoleWrite(1)
    EndIf
EndFunc   ;==>Mode_2

Func Mode_3()
    If $lastMenu <> $vMessages Then
        Local $CGP = ControlGetPos($UI, '', $vMessages)
        GUICtrlSetPos($vIndicator, 0, $CGP[1])
        GUICtrlSetColor($vMessages, $cTextA)
        GUICtrlSetColor($lastMenu, $cText)
        $lastMenu = $vMessages
        GUICtrlSetState($Button1, $GUI_HIDE)
        GUICtrlSetState($Button2, $GUI_HIDE)
        GUICtrlSetState($Button3, $GUI_HIDE)
        GUICtrlSetState($Button4, $GUI_HIDE)
        GUICtrlSetState($Button5, $GUI_HIDE)
        GUICtrlSetState($Button6, $GUI_HIDE)
        GUICtrlSetState($Button7, $GUI_HIDE)
        GUICtrlSetState($Button8, $GUI_HIDE)
        GUICtrlSetState($Button9, $GUI_HIDE)
        GUICtrlSetState($Button10, $GUI_HIDE)
        GUICtrlSetState($Button11, $GUI_HIDE)
        GUICtrlSetState($Button12, $GUI_HIDE)
        GUICtrlSetState($Button13, $GUI_HIDE)
        GUICtrlSetState($Button14, $GUI_HIDE)
        GUICtrlSetState($Button15, $GUI_HIDE)
        GUICtrlSetState($Checkbox1, $GUI_HIDE)
        GUICtrlSetState($Checkbox2, $GUI_HIDE)
        GUICtrlSetState($Checkbox3, $GUI_HIDE)
        GUICtrlSetState($Checkbox4, $GUI_HIDE)
        GUICtrlSetState($Checkbox5, $GUI_HIDE)
        GUICtrlSetState($Checkbox6, $GUI_HIDE)
        GUICtrlSetState($Checkbox7, $GUI_HIDE)
        GUICtrlSetState($Checkbox8, $GUI_HIDE)
        GUICtrlSetState($Checkbox9, $GUI_HIDE)
        GUICtrlSetState($Checkbox10, $GUI_HIDE)
        ConsoleWrite(1)
    EndIf
EndFunc   ;==>Mode_3

Func Terminate()
    GUIDelete($UI)
    Exit
EndFunc   ;==>Terminate

Func Minimize()
    GUISetState(@SW_MINIMIZE, $UI)
EndFunc   ;==>Minimize


Func Topmost()
    If $isOnTop = False Then
        WinSetOnTop($UI, Default, 1)
        $isOnTop = True
    Else
        WinSetOnTop($UI, Default, 0)
        $isOnTop = False
    EndIf
EndFunc   ;==>Topmost

Func CalcPercent($vPercent, $vInt) ; Calculate percent % :)
    Return $vPercent * $vInt / 100
EndFunc   ;==>CalcPercent
 

ra4o

AutoIT Гуру
Сообщения
1,165
Репутация
247
прорисовка кнопок мелькает
Уберите "GUISetState(@SW_SHOW, $UI)" в начале, массу лишних "GUISetState()" по мере создания элементов GUI и не будет мигать прорисовка при загрузке
Код:
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
#include <String.au3>
#include <Crypt.au3>
#include <WinAPISysWin.au3>
#include <FileConstants.au3>
#RequireAdmin
#NoTrayIcon

Opt("GUIOnEventMode", 1)

Global $Assets = @ScriptDir & "\Assets\"
Global $cUI_BK = 0x02101B
Global $cContent_BK = 0x091926
Global $cText = 0xDEDEDE
Global $cTextA = 0x56CBDD
Global $cCardBk = 0x0C1C29
Global $lastMenu = Default
Global $isOnTop = False
Global $ui_w = 800
Global $ui_h = 520
Global $topPanel_h = CalcPercent(12, $ui_h)
Global $bottomPanel_h = CalcPercent(8, $ui_h)
Global $bottomPanel_y = $ui_h - $bottomPanel_h
Global $leftPanel_w = CalcPercent(25, $ui_w)
Global $contentPanel_x = $leftPanel_w
Global $contentPanel_y = $topPanel_h
Global $contentPanel_w = $ui_w - $leftPanel_w
Global $contentPanel_h = $ui_h - ($topPanel_h + $bottomPanel_h)


Global $UI = GUICreate("Experience UI", $ui_w, $ui_h) ; $WS_POPUP, $WS_EX_CONTROLPARENT
WinSetTrans($UI, "", 0) ;

For $i = 0 To 243 Step 2
    WinSetTrans($UI, "", $i) ;Прозрачность 0-255

Next

GUISetOnEvent(-3, "Terminate", $UI)
GUISetBkColor($cUI_BK, $UI)

Global $topPanel = GUICtrlCreateLabel("", 0, 0, $ui_w, $topPanel_h) ; height = 12% from UI | (ps. $GUI_WS_EX_PARENTDRAG)
GUICtrlSetState($topPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($topPanel, $cUI_BK)

Global $bottomPanel = GUICtrlCreateLabel("", 0, $bottomPanel_y, $ui_w, $bottomPanel_h)
GUICtrlSetState($bottomPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($bottomPanel, $cUI_BK)

Global $leftPanel = GUICtrlCreateLabel("", 0, $topPanel_h, $leftPanel_w, $ui_h - ($topPanel_h + $bottomPanel_h))
GUICtrlSetState($leftPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($leftPanel, $cUI_BK)

Global $contentPanel = GUICtrlCreateLabel("", $contentPanel_x, $contentPanel_y, $contentPanel_w, $contentPanel_h)
GUICtrlSetState($contentPanel, 128) ; $GUI_DISABLE
GUICtrlSetBkColor($contentPanel, $cContent_BK)

$y = $bottomPanel_y + (($bottomPanel_h / 2) - (28 / 2))
GUICtrlCreateLabel("© 2020 by DiJo.", 10, $y, $leftPanel_w - 38, 28, 0x0200)
GUICtrlSetFont(-1, 8, Default, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)

Global $y = $topPanel_h
GUICtrlCreateLabel(" FNKC Pack", 52, $y, $leftPanel_w - 52, 32, 0x0200)
GUICtrlSetFont(-1, 12, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)

$y += 50
Global $vDashboard = GUICtrlCreateLabel("Mode 1", 38, $y, $leftPanel_w - 38, 32, 0x0200)
GUICtrlSetOnEvent(-1, "Mode_1")
GUICtrlSetFont(-1, 11, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cTextA)
GUICtrlSetCursor(-1, 0)
$lastMenu =''; $vDashboard
$y += 32
Global $vWallet = GUICtrlCreateLabel("Mode 2", 38, $y, $leftPanel_w - 38, 32, 0x0200)
GUICtrlSetOnEvent(-1, "Mode_2")
GUICtrlSetFont(-1, 11, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)
GUICtrlSetCursor(-1, 0)
$y += 32
Global $vMessages = GUICtrlCreateLabel("Mode 3", 38, $y, $leftPanel_w - 38, 32, 0x0200)
GUICtrlSetOnEvent(-1, "Mode_3")
GUICtrlSetFont(-1, 11, 600, Default, "Segoe UI", 5) ; 5 = Clear Type
GUICtrlSetColor(-1, $cText)
GUICtrlSetCursor(-1, 0)

$y = ($topPanel_h + 50)
Global $vIndicator = GUICtrlCreateLabel("", 0, $y, 4, 32)
GUICtrlSetBkColor(-1, $cTextA)


$x = $contentPanel_x + 10
$y = $contentPanel_y + 15
Global $iHostName = GUICtrlCreateInput("HOST", 412, 90, 180, 21, $ES_CENTER)
Global $Button1 = GUICtrlCreateButton("Ping", $x, $y + 80, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button1")

Global $Button2 = GUICtrlCreateButton("ChangePass", $x + 310, $y + 80, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button2")

Global $Button3 = GUICtrlCreateButton("Logus", $x, $y + 140, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button3")

Global $Button4 = GUICtrlCreateButton("Microb KDL", $x + 310, $y + 140, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button4")

Global $Button5 = GUICtrlCreateButton("Net Aact_64", $x, $y + 200, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button5")

Global $Button6 = GUICtrlCreateButton("Net Aact_86", $x + 310, $y + 200, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button6")

Global $Button7 = GUICtrlCreateButton("Net Aact_64_GVLK", $x, $y + 260, 267, 43)  ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button7")

Global $Button8 = GUICtrlCreateButton("Net Aact_86_GVLK", $x + 310, $y + 260, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button8")

Global $Button9 = GUICtrlCreateButton("CCSP", $x, $y + 320, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button9")

Global $Button10 = GUICtrlCreateButton("DameWare", $x + 310, $y + 320, 267, 43) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button10")

Global $Button11 = GUICtrlCreateButton("Start", $x + 150, $y + 40, 73, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button11")

Global $Button12 = GUICtrlCreateButton("x64", $x + 230, $y + 40, 53, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button12")

Global $Button13 = GUICtrlCreateButton("x86", $x + 295, $y + 40, 53, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button13")

Global $Button14 = GUICtrlCreateButton("Reboot", $x + 355, $y + 40, 73, 33) ;создаем кнопку подключения
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button14")

Global $Button15 = GUICtrlCreateButton("Chrome", $x, $y + 80, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;задаем стиль элементу выше
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0E0C2E)
GUICtrlSetOnEvent(-1, "_Button15")

Global $Checkbox1 = GUICtrlCreateCheckbox("", $x + 273, $y + 95, 12, 12)
Global $Checkbox2 = GUICtrlCreateCheckbox("", $x + 293, $y + 95, 12, 12)
Global $Checkbox3 = GUICtrlCreateCheckbox("", $x + 273, $y + 155, 12, 12)
Global $Checkbox4 = GUICtrlCreateCheckbox("", $x + 293, $y + 155, 12, 12)
Global $Checkbox5 = GUICtrlCreateCheckbox("", $x + 273, $y + 215, 12, 12)
Global $Checkbox6 = GUICtrlCreateCheckbox("", $x + 293, $y + 215, 12, 12)
Global $Checkbox7 = GUICtrlCreateCheckbox("", $x + 273, $y + 275, 12, 12)
Global $Checkbox8 = GUICtrlCreateCheckbox("", $x + 293, $y + 275, 12, 12)
Global $Checkbox9 = GUICtrlCreateCheckbox("", $x + 273, $y + 335, 12, 12)
Global $Checkbox10 = GUICtrlCreateCheckbox("", $x + 293, $y + 335, 12, 12)
Mode_1()
GUISetState() ; Show GUI
Local $rHostName


While True
    Sleep(10)
WEnd

Func Mode_1()
    If $lastMenu <> $vDashboard Then
        Local $CGP = ControlGetPos($UI, '', $vDashboard)
        GUICtrlSetPos($vIndicator, 0, $CGP[1])
        GUICtrlSetColor($vDashboard, $cTextA)
        GUICtrlSetColor($lastMenu, $cText)
        $lastMenu = $vDashboard
        GUICtrlSetState($Button1, $GUI_HIDE)
        GUICtrlSetState($Button2, $GUI_HIDE)
        GUICtrlSetState($Button3, $GUI_HIDE)
        GUICtrlSetState($Button4, $GUI_HIDE)
        GUICtrlSetState($Button5, $GUI_HIDE)
        GUICtrlSetState($Button6, $GUI_HIDE)
        GUICtrlSetState($Button7, $GUI_HIDE)
        GUICtrlSetState($Button8, $GUI_HIDE)
        GUICtrlSetState($Button9, $GUI_HIDE)
        GUICtrlSetState($Button10, $GUI_HIDE)
        GUICtrlSetState($Button11, $GUI_HIDE)
        GUICtrlSetState($Button12, $GUI_HIDE)
        GUICtrlSetState($Button13, $GUI_HIDE)
        GUICtrlSetState($Button14, $GUI_HIDE)
        GUICtrlSetState($Button15, $GUI_SHOW)
        GUICtrlSetState($Checkbox1, $GUI_HIDE)
        GUICtrlSetState($Checkbox2, $GUI_HIDE)
        GUICtrlSetState($Checkbox3, $GUI_HIDE)
        GUICtrlSetState($Checkbox4, $GUI_HIDE)
        GUICtrlSetState($Checkbox5, $GUI_HIDE)
        GUICtrlSetState($Checkbox6, $GUI_HIDE)
        GUICtrlSetState($Checkbox7, $GUI_HIDE)
        GUICtrlSetState($Checkbox8, $GUI_HIDE)
        GUICtrlSetState($Checkbox9, $GUI_HIDE)
        GUICtrlSetState($Checkbox10, $GUI_HIDE)
        ConsoleWrite(1)
    EndIf
EndFunc   ;==>Mode_1

Func Mode_2()
    If $lastMenu <> $vWallet Then
        Local $CGP = ControlGetPos($UI, '', $vWallet)
        GUICtrlSetPos($vIndicator, 0, $CGP[1])
        GUICtrlSetColor($vWallet, $cTextA)
        GUICtrlSetColor($lastMenu, $cText)
        $lastMenu = $vWallet
        GUICtrlSetState($Button1, $GUI_SHOW)
        GUICtrlSetState($Button2, $GUI_SHOW)
        GUICtrlSetState($Button3, $GUI_SHOW)
        GUICtrlSetState($Button4, $GUI_SHOW)
        GUICtrlSetState($Button5, $GUI_SHOW)
        GUICtrlSetState($Button6, $GUI_SHOW)
        GUICtrlSetState($Button7, $GUI_SHOW)
        GUICtrlSetState($Button8, $GUI_SHOW)
        GUICtrlSetState($Button9, $GUI_SHOW)
        GUICtrlSetState($Button10, $GUI_SHOW)
        GUICtrlSetState($Button11, $GUI_SHOW)
        GUICtrlSetState($Button12, $GUI_SHOW)
        GUICtrlSetState($Button13, $GUI_SHOW)
        GUICtrlSetState($Button14, $GUI_SHOW)
        GUICtrlSetState($Button15, $GUI_HIDE)
        GUICtrlSetState($Checkbox1, $GUI_SHOW)
        GUICtrlSetState($Checkbox2, $GUI_SHOW)
        GUICtrlSetState($Checkbox3, $GUI_SHOW)
        GUICtrlSetState($Checkbox4, $GUI_SHOW)
        GUICtrlSetState($Checkbox5, $GUI_SHOW)
        GUICtrlSetState($Checkbox6, $GUI_SHOW)
        GUICtrlSetState($Checkbox7, $GUI_SHOW)
        GUICtrlSetState($Checkbox8, $GUI_SHOW)
        GUICtrlSetState($Checkbox9, $GUI_SHOW)
        GUICtrlSetState($Checkbox10, $GUI_SHOW)
        ConsoleWrite(1)
        ConsoleWrite(1)
    EndIf
EndFunc   ;==>Mode_2

Func Mode_3()
    If $lastMenu <> $vMessages Then
        Local $CGP = ControlGetPos($UI, '', $vMessages)
        GUICtrlSetPos($vIndicator, 0, $CGP[1])
        GUICtrlSetColor($vMessages, $cTextA)
        GUICtrlSetColor($lastMenu, $cText)
        $lastMenu = $vMessages
        GUICtrlSetState($Button1, $GUI_HIDE)
        GUICtrlSetState($Button2, $GUI_HIDE)
        GUICtrlSetState($Button3, $GUI_HIDE)
        GUICtrlSetState($Button4, $GUI_HIDE)
        GUICtrlSetState($Button5, $GUI_HIDE)
        GUICtrlSetState($Button6, $GUI_HIDE)
        GUICtrlSetState($Button7, $GUI_HIDE)
        GUICtrlSetState($Button8, $GUI_HIDE)
        GUICtrlSetState($Button9, $GUI_HIDE)
        GUICtrlSetState($Button10, $GUI_HIDE)
        GUICtrlSetState($Button11, $GUI_HIDE)
        GUICtrlSetState($Button12, $GUI_HIDE)
        GUICtrlSetState($Button13, $GUI_HIDE)
        GUICtrlSetState($Button14, $GUI_HIDE)
        GUICtrlSetState($Button15, $GUI_HIDE)
        GUICtrlSetState($Checkbox1, $GUI_HIDE)
        GUICtrlSetState($Checkbox2, $GUI_HIDE)
        GUICtrlSetState($Checkbox3, $GUI_HIDE)
        GUICtrlSetState($Checkbox4, $GUI_HIDE)
        GUICtrlSetState($Checkbox5, $GUI_HIDE)
        GUICtrlSetState($Checkbox6, $GUI_HIDE)
        GUICtrlSetState($Checkbox7, $GUI_HIDE)
        GUICtrlSetState($Checkbox8, $GUI_HIDE)
        GUICtrlSetState($Checkbox9, $GUI_HIDE)
        GUICtrlSetState($Checkbox10, $GUI_HIDE)
        ConsoleWrite(1)
    EndIf
EndFunc   ;==>Mode_3

Func Terminate()
    GUIDelete($UI)
    Exit
EndFunc   ;==>Terminate

Func Minimize()
    GUISetState(@SW_MINIMIZE, $UI)
EndFunc   ;==>Minimize


Func Topmost()
    If $isOnTop = False Then
        WinSetOnTop($UI, Default, 1)
        $isOnTop = True
    Else
        WinSetOnTop($UI, Default, 0)
        $isOnTop = False
    EndIf
EndFunc   ;==>Topmost

Func CalcPercent($vPercent, $vInt) ; Calculate percent % :)
    Return $vPercent * $vInt / 100
EndFunc   ;==>CalcPercent
 
Верх