
akRJ
Members-
Posts
8 -
Joined
-
Last visited
Everything posted by akRJ
-
You, my friend, are a lifesaver! Thanks!
-
I can't for the life of me see what I'm doing wrong here. I've searched up and down the forums and still can't figure it out. I just want 'enter' to call a function like it would with HotKeySet. #include <Array.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <Misc.au3> #include <GUIEdit.au3> #include <ScrollBarConstants.au3> #include <GUIComboBoxex.au3> #include <ComboConstants.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 890, 648, 497, 263, $WS_SIZEBOX + $WS_SYSMENU , $WS_EX_TOPMOST) GUISetBkColor(0x000000) GUICtrlSetImage($form1, "icon.ico") GUISetOnEvent($GUI_EVENT_CLOSE, "_quit") $Input = GUICtrlCreateInput("", 8, 560, 609, 21) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUISetOnEvent($input, "test") GUICtrlSetBkColor($Input, 0x000000) GUICtrlSetColor($Input, 0x00FF00) $history = GUICtrlCreateEdit("", 8, 56, 609, 489) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetData(-1, "Hello!"& @CRLF) GUICtrlSetBkColor($history, 0x000000) GUICtrlSetColor($history, 0x00FF00) $List1 = GUICtrlCreateList("", 648, 56, 161, 487) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetBkColor($List1, 0x000000) GUICtrlSetColor($List1, 0x00FF00) $hDummy = GUICtrlCreateDummy() GUISetOnEvent(-1, "test") GUISetState(@SW_SHOW) ;~ Dim $accelkeys[1][2]= [["{ENTER}", $hDummy ]] ;Does not work at all ;~ GUISetAccelerators($accelkeys) HotKeySet("{ENTER}", "test") ; works fine While 1 Sleep(10) WEnd Func test() MsgBox(1, "", "") EndFunc Func _quit() Exit EndFunc Any help would be greatly appreciated. I'm feel like i'm taking crazy pills.
-
please tell me there is a better way to do this
akRJ replied to akRJ's topic in AutoIt GUI Help and Support
yeah, but it would sort of defeat the point, i guess now its hard to see what i'm doing without the whole code, here it is: #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Dim $i = 1 Dim $response, $reponse Dim $label Global $BtnD[51], $BtnL[26], $left = 40, $top = 8, $Cnt = 0, $a, $b $loginServer = InputBox("PDC","Please enter the login server for this site","server01") $pass = InputBox("VNC password", "Enter the vnc password for this location", "******") FileWriteLine("Login_server.txt",$loginServer) DirCreate("\\"&$loginServer&"\temp\dpt\maintenance\"&@MON&"-"&@MDAY&"-"&@YEAR) $Form1 = GUICreate("Maintenance Console ", 882, 701, 193, 115) $Group1 = GUICtrlCreateGroup("PCs", 192, 8, 689, 649) For $ii = 1 To 3 $top = 8 $left += 160 For $x = 1 To 25 $top += 24 If $ii >= 3 Then $BtnL[$x] = GUICtrlCreateButton("Laptop " & $x, $left, $top, 89, 17, 0) Else If $ii >= 2 Then $Cnt = 25 $BtnD[$x + $Cnt] = GUICtrlCreateButton("Desktop " & $x + $Cnt, $left, $top, 89, 17, 0) EndIf Next Next $btn_wake = GUICtrlCreateButton("Wake all PCs", 0, 136, 185, 65, 0) $btn_connect = GUICtrlCreateButton("Establish Connection", 0, 232, 185, 65, 0) $btn_deploy = GUICtrlCreateButton("Deploy Client", 0, 424, 185, 65, 0) $btn_vnc = GUICtrlCreateButton("VNC all PCs", 0, 328, 185, 65, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btn_connect est_connect() Case $btn_wake ShellExecute("\\"&$loginServer&"\Temp\dpt\wakeall.bat") Case $btn_vnc vnc_all() Case $btn_deploy deploy() Case $BtnD[1] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop1 /password "&$pass) Case $BtnD[2] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop2 /password "&$pass) Case $BtnD[3] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop3 /password "&$pass) Case $BtnD[4] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop4 /password "&$pass) Case $BtnD[5] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop5 /password "&$pass) Case $BtnD[6] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop6 /password "&$pass) Case $BtnD[7] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop7 /password "&$pass) Case $BtnD[8] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop8 /password "&$pass) Case $BtnD[9] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop9 /password "&$pass) Case $BtnD[10] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop10 /password "&$pass) Case $BtnD[11] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop11 /password "&$pass) Case $BtnD[12] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop12 /password "&$pass) Case $BtnD[13] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop13 /password "&$pass) Case $BtnD[14] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop14 /password "&$pass) Case $BtnD[15] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop15 /password "&$pass) Case $BtnD[16] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop16 /password "&$pass) Case $BtnD[17] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop17 /password "&$pass) Case $BtnD[18] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop18 /password "&$pass) Case $BtnD[19] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop19 /password "&$pass) Case $BtnD[20] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop20 /password "&$pass) Case $BtnD[21] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop21 /password "&$pass) Case $BtnD[22] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop22 /password "&$pass) Case $BtnD[23] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop23 /password "&$pass) Case $BtnD[24] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop24 /password "&$pass) Case $BtnD[25] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop25 /password "&$pass) Case $BtnD[26] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop26 /password "&$pass) Case $BtnD[27] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop27 /password "&$pass) Case $BtnD[28] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop28 /password "&$pass) Case $BtnD[29] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop29 /password "&$pass) Case $BtnD[30] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop30 /password "&$pass) Case $BtnD[31] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop31 /password "&$pass) Case $BtnD[32] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop32 /password "&$pass) Case $BtnD[33] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop33 /password "&$pass) Case $BtnD[34] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop34 /password "&$pass) Case $BtnD[35] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop35 /password "&$pass) Case $BtnD[36] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop36 /password "&$pass) Case $BtnD[37] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop37 /password "&$pass) Case $BtnD[38] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop38 /password "&$pass) Case $BtnD[39] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop39 /password "&$pass) Case $BtnD[40] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop40 /password "&$pass) Case $BtnD[41] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop41 /password "&$pass) Case $BtnD[42] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop42 /password "&$pass) Case $BtnD[43] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop43 /password "&$pass) Case $BtnD[44] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop44 /password "&$pass) Case $BtnD[45] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop45 /password "&$pass) Case $BtnD[46] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop46 /password "&$pass) Case $BtnD[47] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop47 /password "&$pass) Case $BtnD[48] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop48 /password "&$pass) Case $BtnD[49] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop49 /password "&$pass) Case $BtnD[50] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop50 /password "&$pass) Case $BtnL[1] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop1 /password "&$pass) Case $BtnL[2] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop2 /password "&$pass) Case $BtnL[3] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop3 /password "&$pass) Case $BtnL[4] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop4 /password "&$pass) Case $BtnL[5] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop5 /password "&$pass) Case $BtnL[6] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop6 /password "&$pass) Case $BtnL[7] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop7 /password "&$pass) Case $BtnL[8] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop8 /password "&$pass) Case $BtnL[9] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop9 /password "&$pass) Case $BtnL[10] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop10 /password "&$pass) Case $BtnL[11] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop11 /password "&$pass) Case $BtnL[12] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop12 /password "&$pass) Case $BtnL[13] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop13 /password "&$pass) Case $BtnL[14] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop14 /password "&$pass) Case $BtnL[15] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop15 /password "&$pass) Case $BtnL[16] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop16 /password "&$pass) Case $BtnL[17] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop17 /password "&$pass) Case $BtnL[18] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop18 /password "&$pass) Case $BtnL[19] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop19 /password "&$pass) Case $BtnL[20] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop20 /password "&$pass) Case $BtnL[21] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop21 /password "&$pass) Case $BtnL[22] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop22 /password "&$pass) Case $BtnL[23] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop23 /password "&$pass) Case $BtnL[24] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop24 /password "&$pass) Case $BtnL[25] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop25 /password "&$pass) EndSwitch WEnd Func est_connect() $i = 1 Do $reponse = Ping("desktop"&$i, 1000) ;MsgBox(1,"",$reponse&" "&@error) If $reponse >= 1 Then GUICtrlSetBkColor($BtnD[$i], 0x00FF00) ElseIf @error = 1 Then GUICtrlSetBkColor($BtnD[$i], 0xFF0000) ElseIf @error = 3 Then GUICtrlSetBkColor($BtnD[$i], 0xFFFF00) ElseIf $reponse = 0 AND @error = 4 Then GUICtrlSetBkColor($BtnD[$i], 0xFFFF00) ;Else ;MsgBox(4096, "Error", $reponse) EndIf $i = $i + 1 Until $i = 51 $i = 1 Do $reponse = Ping("laptop"&$i, 1000) ;MsgBox(1,"",$reponse&" "&@error) If $reponse >= 1 Then GUICtrlSetBkColor($BtnL[$i], 0x00FF00) ElseIf @error = 1 Then GUICtrlSetBkColor($BtnL[$i], 0xFF0000) ElseIf @error = 3 Then GUICtrlSetBkColor($BtnL[$i], 0xFFFF00) ElseIf $reponse = 0 AND @error = 4 Then GUICtrlSetBkColor($BtnL[$i], 0xFFFF00) ;Else ;MsgBox(4096, "Error", $reponse) EndIf $i = $i + 1 Until $i = 26 EndFunc ;==>est_connect Func vnc_all() $ip = @IPAddress1 $ip = StringLeft($ip, 11) Run(@ComSpec & " /c" & "\\"&$loginServer&"\Temp\dpt\vncall.bat"&" "&$ip&" "&$pass) EndFunc Func deploy() $i = 1 Do FileCopy("\\"&$loginServer&"\temp\dpt\maintenance\Login_server.txt","C:\dpt", 1) FileCopy("\\"&$loginServer&"\temp\dpt\maintenance\maintenance_client.exe","\\desktop"&$i&"\c$\Documents and Settings\All Users\Start Menu\Programs\Startup", 1) $i = $i + 1 Until $i = 51 $i = 1 Do FileCopy("Login_server.txt","\\laptop"&$i&"\c$\dpt", 1) FileCopy("maintenance_client.exe","\\laptop"&$i&"\c$\Documents and Settings\All Users\Start Menu\Programs\Startup", 1) $i = $i + 1 Until $i = 26 EndFunc it shows you what computers are online after hiting the establish connection button, and then from there you can click the computer to VNC it -
please tell me there is a better way to do this
akRJ replied to akRJ's topic in AutoIt GUI Help and Support
its really cumbersome I know -
please tell me there is a better way to do this
akRJ replied to akRJ's topic in AutoIt GUI Help and Support
-
Hey guys, I have a GUI that has a lot of buttons, all of the buttons launch a vnc window to the target computer on the button. this is the code i wrote because i'm awful with arrays, i imagine there is a much easier way to do this thanks! Case $BtnD[1] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop1 /password "&$pass) Case $BtnD[2] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop2 /password "&$pass) Case $BtnD[3] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop3 /password "&$pass) Case $BtnD[4] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop4 /password "&$pass) Case $BtnD[5] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop5 /password "&$pass) Case $BtnD[6] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop6 /password "&$pass) Case $BtnD[7] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop7 /password "&$pass) Case $BtnD[8] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop8 /password "&$pass) Case $BtnD[9] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop9 /password "&$pass) Case $BtnD[10] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop10 /password "&$pass) Case $BtnD[11] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop11 /password "&$pass) Case $BtnD[12] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop12 /password "&$pass) Case $BtnD[13] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop13 /password "&$pass) Case $BtnD[14] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop14 /password "&$pass) Case $BtnD[15] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop15 /password "&$pass) Case $BtnD[16] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop16 /password "&$pass) Case $BtnD[17] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop17 /password "&$pass) Case $BtnD[18] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop18 /password "&$pass) Case $BtnD[19] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop19 /password "&$pass) Case $BtnD[20] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop20 /password "&$pass) Case $BtnD[21] Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop21 /password "&$pass)
-
changing multiple button colors during a loop
akRJ replied to akRJ's topic in AutoIt GUI Help and Support
It uses the response back from the ping to determine what color the buttons for each computer will turn, online = green, off = red, bad name = yellow. Other than that your suggestion was brilliant, thanks! -
Hey guys, i have a quick question. I have a script i'm writing that will go off and verify if a computer is online, offline or not on the network with the Ping command, and then change that computer's button on the gui to green, red, or yellow. I can't seem to get the loop down for changing the colors. any help would be much appreciated! here is my code. Dim $i = 1 dim $response dim $label #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Maintenance Console ", 882, 701, 193, 115) $Group1 = GUICtrlCreateGroup("PCs", 192, 8, 689, 649) $btn_d1 = GUICtrlCreateButton("Desktop1", 200, 32, 89, 17, 0) $btn_d2 = GUICtrlCreateButton("Desktop2", 200, 56, 89, 17, 0) $btn_d3 = GUICtrlCreateButton("Desktop3", 200, 80, 89, 17, 0) $btn_d4 = GUICtrlCreateButton("Desktop4", 200, 104, 89, 17, 0) $btn_d5 = GUICtrlCreateButton("Desktop5", 200, 128, 89, 17, 0) $btn_d7 = GUICtrlCreateButton("Desktop7", 200, 176, 89, 17, 0) $btn_d10 = GUICtrlCreateButton("Desktop10", 200, 248, 89, 17, 0) $btn_d8 = GUICtrlCreateButton("Desktop8", 200, 200, 89, 17, 0) $btn_d6 = GUICtrlCreateButton("Desktop6", 200, 152, 89, 17, 0) $btn_d9 = GUICtrlCreateButton("Desktop9", 200, 224, 89, 17, 0) $btn_d14 = GUICtrlCreateButton("Desktop14", 200, 344, 89, 17, 0) $btn_d13 = GUICtrlCreateButton("Desktop13", 200, 320, 89, 17, 0) $btn_d35 = GUICtrlCreateButton("Desktop35", 360, 248, 89, 17, 0) $btn_d15 = GUICtrlCreateButton("Desktop15", 200, 368, 89, 17, 0) $btn_d12 = GUICtrlCreateButton("Desktop12", 200, 296, 89, 17, 0) $btn_d16 = GUICtrlCreateButton("Desktop16", 200, 392, 89, 17, 0) $btn_d11 = GUICtrlCreateButton("Desktop11", 200, 272, 89, 17, 0) $btn_d37 = GUICtrlCreateButton("Desktop37", 360, 296, 89, 17, 0) $btn_d36 = GUICtrlCreateButton("Desktop36", 360, 272, 89, 17, 0) $btn_d41 = GUICtrlCreateButton("Desktop41", 360, 392, 89, 17, 0) $btn_d38 = GUICtrlCreateButton("Desktop38", 360, 320, 89, 17, 0) $btn_d40 = GUICtrlCreateButton("Desktop40", 360, 368, 89, 17, 0) $btn_d42 = GUICtrlCreateButton("Desktop42", 360, 416, 89, 17, 0) $btn_d50 = GUICtrlCreateButton("Desktop50", 360, 608, 89, 17, 0) $btn_d39 = GUICtrlCreateButton("Desktop39", 360, 344, 89, 17, 0) $btn_d43 = GUICtrlCreateButton("Desktop43", 360, 440, 89, 17, 0) $btn_d44 = GUICtrlCreateButton("Desktop44", 360, 464, 89, 17, 0) $btn_d45 = GUICtrlCreateButton("Desktop45", 360, 488, 89, 17, 0) $btn_d46 = GUICtrlCreateButton("Desktop46", 360, 512, 89, 17, 0) $btn_d47 = GUICtrlCreateButton("Desktop47", 360, 536, 89, 17, 0) $btn_d48 = GUICtrlCreateButton("Desktop48", 360, 560, 89, 17, 0) $btn_d49 = GUICtrlCreateButton("Desktop49", 360, 584, 89, 17, 0) $btn_25 = GUICtrlCreateButton("Desktop25", 200, 608, 89, 17, 0) $btn_d24 = GUICtrlCreateButton("Desktop24", 200, 584, 89, 17, 0) $btn_d23 = GUICtrlCreateButton("Desktop23", 200, 560, 89, 17, 0) $btn_d22 = GUICtrlCreateButton("Desktop22", 200, 536, 89, 17, 0) $btn_21 = GUICtrlCreateButton("Desktop21", 200, 512, 89, 17, 0) $btn_d20 = GUICtrlCreateButton("Desktop20", 200, 488, 89, 17, 0) $btn_d19 = GUICtrlCreateButton("Desktop19", 200, 464, 89, 17, 0) $btn_d18 = GUICtrlCreateButton("Desktop18", 200, 440, 89, 17, 0) $btn_d17 = GUICtrlCreateButton("Desktop17", 200, 416, 89, 17, 0) $btn_d34 = GUICtrlCreateButton("Desktop34", 360, 224, 89, 17, 0) $btn_l1 = GUICtrlCreateButton("Laptop1", 520, 32, 89, 17, 0) $btn_d28 = GUICtrlCreateButton("Desktop28", 360, 80, 89, 17, 0) $btn_d29 = GUICtrlCreateButton("Desktop29", 360, 104, 89, 17, 0) $btn_l2 = GUICtrlCreateButton("Laptop2", 520, 56, 89, 17, 0) $btn_d30 = GUICtrlCreateButton("Desktop30", 360, 128, 89, 17, 0) $btn_d27 = GUICtrlCreateButton("Desktop27", 360, 56, 89, 17, 0) $btn_l3 = GUICtrlCreateButton("Laptop3", 520, 80, 89, 17, 0) $btn_l4 = GUICtrlCreateButton("Laptop4", 520, 104, 89, 17, 0) $btn_l5 = GUICtrlCreateButton("Laptop5", 520, 128, 89, 17, 0) $btn_d26 = GUICtrlCreateButton("Desktop26", 360, 32, 89, 17, 0) $btn_d31 = GUICtrlCreateButton("Desktop31", 360, 152, 89, 17, 0) $btn_d32 = GUICtrlCreateButton("Desktop32", 360, 176, 89, 17, 0) $btn_d33 = GUICtrlCreateButton("Desktop33", 360, 200, 89, 17, 0) $btn_l11 = GUICtrlCreateButton("Laptop11", 520, 272, 89, 17, 0) $btn_l6 = GUICtrlCreateButton("Laptop6", 520, 152, 89, 17, 0) $btn_l12 = GUICtrlCreateButton("Laptop12", 520, 296, 89, 17, 0) $btn_l9 = GUICtrlCreateButton("Laptop9", 520, 224, 89, 17, 0) $btn_l8 = GUICtrlCreateButton("Laptop8", 520, 200, 89, 17, 0) $btn_l10 = GUICtrlCreateButton("Laptop10", 520, 248, 89, 17, 0) $btn_l7 = GUICtrlCreateButton("Laptop7", 520, 176, 89, 17, 0) $btn_l13 = GUICtrlCreateButton("Laptop13", 520, 320, 89, 17, 0) $btn_l14 = GUICtrlCreateButton("Laptop14", 520, 344, 89, 17, 0) $btn_l15 = GUICtrlCreateButton("Laptop15", 520, 368, 89, 17, 0) $btn_l16 = GUICtrlCreateButton("Laptop16", 520, 392, 89, 17, 0) $btn_l17 = GUICtrlCreateButton("Laptop17", 520, 416, 89, 17, 0) $btn_l18 = GUICtrlCreateButton("Laptop18", 520, 440, 89, 17, 0) $btn_l19 = GUICtrlCreateButton("Laptop19", 520, 464, 89, 17, 0) $btn_l20 = GUICtrlCreateButton("Laptop20", 520, 488, 89, 17, 0) $btn_l21 = GUICtrlCreateButton("Laptop21", 520, 512, 89, 17, 0) $btn_l22 = GUICtrlCreateButton("Laptop22", 520, 536, 89, 17, 0) $btn_l23 = GUICtrlCreateButton("Laptop23", 520, 560, 89, 17, 0) $btn_l24 = GUICtrlCreateButton("Laptop24", 520, 584, 89, 17, 0) $btn_l25 = GUICtrlCreateButton("Laptop25", 520, 608, 89, 17, 0) $btn_wake = GUICtrlCreateButton("Wake all PCs", 0, 136, 185, 65, 0) $btn_connect = GUICtrlCreateButton("Connect to PCs", 0, 232, 185, 65, 0) $btn_deploy = GUICtrlCreateButton("Deploy Client", 0, 424, 185, 65, 0) $btn_vnc = GUICtrlCreateButton("VNC all PCs", 0, 328, 185, 65, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btn_connect est_connect() EndSwitch WEnd Func est_connect() Do $label = "$btn_d"&$i $reponse = Ping("dpt"&$i) If $reponse = 1 then MsgBox(1,"",$label) GUICtrlSetBkColor($label, 0x00FF00) ElseIf @error = 1 then ElseIf @error = 4 Then EndIf $i = $i + 1 Until $i = 51 EndFunc