#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=6xvZTEUi_400x400.ico #AutoIt3Wrapper_Res_Icon_Add=C:\Users\Dani\Desktop\LOGO.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include #include #include #include #region GLOBAL VARIABLES Global $iW = 600, $iH = 400, $iT = 52, $iB = 52, $iLeftWidth = 150, $iGap = 10, $hMainGUI #endregion GLOBAL VARIABLES _MainGui() Func _MainGui() Local $hFooter, $nMsg, $aPos Local $iLinks = 5 Local $sMainGuiTitle = "Window Title" Local $sHeader = "System Assessment Tool" Local $sFooter = "2017 © dragancla" Local $aLink[$iLinks], $aPanel[$iLinks] $aLink[0] = $iLinks - 1 $aPanel[0] = $iLinks - 1 $hMainGUI = GUICreate($sMainGuiTitle, $iW, $iH, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_TABSTOP)) ;GUISetIcon("shell32.dll", -58, $hMainGUI) ;GUISetBkColor($COLOR_BLACK) dunno why this doesn't work GUICtrlCreateLabel($sHeader, 48, 8, $iW - 56, 32, $SS_CENTERIMAGE) GUICtrlSetFont(-1, 14, 800, 0, "Arial", 5) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) ;GUICtrlCreateIcon("shell32.dll", -44, 8, 8, 32, 32) GUICtrlCreateIcon("C:\Users\Dani\Desktop\6xvZTEUi_400x400.ico", -1, 8, 8, 32, 32) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) GUICtrlCreateLabel("", 0, $iT, $iW, 2, $SS_SUNKEN);separator GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT) GUICtrlCreateLabel("", $iLeftWidth, $iT + 2, 2, $iH - $iT - $iB - 2, $SS_SUNKEN);separator GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKBOTTOM + $GUI_DOCKWIDTH) GUICtrlCreateLabel("", 0, $iH - $iB, $iW, 2, $SS_SUNKEN);separator GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT) $hFooter = GUICtrlCreateLabel($sFooter, 10, $iH - 34, $iW - 20, 17, BitOR($SS_LEFT, $SS_CENTERIMAGE)) GUICtrlSetTip(-1, "2017 © dragancla", "System Assessment Tool") GUICtrlSetCursor(-1, 0) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT) ;add links to the left side $aLink[1] = _AddNewLink("Speed Test", "C:\Users\Dani\Desktop\LOGO.ico") $aLink[2] = _AddNewLink("System Specs", "C:\Users\Dani\Desktop\LOGO.ico") $aLink[3] = _AddNewLink("Installed Programs", "C:\Users\Dani\Desktop\LOGO.ico") $aLink[4] = _AddNewLink("Others", "C:\Users\Dani\Desktop\LOGO.ico") ;and the corresponding GUI's $aPanel[1] = _AddNewPanel("Speed Test") $aPanel[2] = _AddNewPanel("System specifications") $aPanel[3] = _AddNewPanel("Pre-Scan results") $aPanel[4] = _AddNewPanel("Other security solutions installed") ;add some controls to the panels _AddControlsToPanel($aPanel[1]) $hSpeedTestButton = GUICtrlCreateButton("Test Download Speed", 10,50,120,35) $hSpeedTestLabel = GUICtrlCreateEdit("", 170, 57, 190, 20, $ES_READONLY) #comments-start Local $msg Local $iSpeed While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $hSpeedTestButton GUICtrlSetData($hSpeedTestLabel, "") $iSpeed = DownloadSpeed() GUICtrlSetData($hSpeedTestLabel, "Download Speed is: " & $iSpeed) EndSwitch Sleep(10) WEnd #comments-end ;GUICtrlCreateEdit("", 10, 37, $iW - $iLeftWidth + 2 - 20 - 5, $iH - $iT - $iB - 40, BitOR($ES_AUTOVSCROLL, $ES_NOHIDESEL, $ES_WANTRETURN, $WS_VSCROLL), $WS_EX_STATICEDGE) ;GUICtrlCreateButton("Test Download Speed: " & DownloadSpeed(), $ES_READONLY) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) _AddControlsToPanel($aPanel[2]) ; variables for processor & OS Local $HKLMCentralProc = "HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor" Local $CentralProcKey = RegEnumKey($HKLMCentralProc, 1) $a = @OSServicePack If $a == "" Then $a = "Not applicable" EndIf GUICtrlCreateEdit("CPU Name: " & StringStripWS(RegRead($HKLMCentralProc & "\" & $CentralProcKey, "ProcessorNameString"), 1) & @CRLF _ & "RAM: " & Round(MemGetStats()[1] / 1024 / 1024) & " GB" & @CRLF _ & "CPU Architecture: " & @CPUArch & @CRLF _ & "OS Architecture: " & @OSArch & @CRLF _ & "OS Version: " & @OSVersion & @CRLF _ & "OS Service Pack: " & $a & @CRLF _ & "IP Address 1: " & @IPAddress1 & @CRLF _ & "IP Address 2: " & @IPAddress2 & @CRLF _ & "IP Address 3: " & @IPAddress3 & @CRLF _ & "IP Address 4: " & @IPAddress4 & @CRLF _ & "Current logged in user: " & @UserName, 10,50,420,450, $ES_READONLY) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) _AddControlsToPanel($aPanel[3]) GUICtrlCreateList("", 8, 37, 121, 93, -1, 0) GUICtrlSetData(-1, "To be uploaded in Virus Total") GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) _AddControlsToPanel($aPanel[4]) GUICtrlCreateGroup("Group1", 8, 35, 129, 90) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Local $aChkBox[4] For $i = 1 To 3 $aChkBox[$i] = GUICtrlCreateRadio("McAfee" & $i, 16, 56 + ($i - 1) * 20, 113, 17) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Next GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateGroup("", -99, -99, 1, 1) ;set default to Panel1 GUISwitch($aPanel[1]) ;show the main GUI GUISetState(@SW_SHOW, $hMainGUI) While 1 Sleep(10) $nMsg = GUIGetMsg(1) Switch $nMsg[1] Case $hMainGUI Switch $nMsg[0] Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE, $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE $aPos = WinGetPos($hMainGUI) $iW = $aPos[2] $iH = $aPos[3] For $i = 0 To $aPanel[0] WinMove($aPanel[$i], "", $iLeftWidth + 2, $iT, $iW - $iLeftWidth + 2, $iH - $iT - $iB - 20) Next Case $aLink[1], $aLink[2], $aLink[3], $aLink[4] For $i = 1 To $aLink[0] If $nMsg[0] = $aLink[$i] Then GUISetState(@SW_SHOW, $aPanel[$i]) Else GUISetState(@SW_HIDE, $aPanel[$i]) EndIf Next Case $hFooter ShellExecute("") EndSwitch Case $aPanel[2] Switch $nMsg[0] EndSwitch Case $aPanel[4] Switch $nMsg[0] Case $aChkBox[1], $aChkBox[2], $aChkBox[3] For $i = 1 To 3 If GUICtrlRead($aChkBox[$i]) = $GUI_CHECKED Then MsgBox(64, "Security solution", "Remove? " & $i & "!") Next EndSwitch EndSwitch WEnd EndFunc ;==>_MainGui Func _AddNewLink($sTxt, $iIcon) Local $hLink = GUICtrlCreateLabel($sTxt, 36, $iT + $iGap, $iLeftWidth - 46, 17) GUICtrlSetCursor(-1, 0) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) ;GUICtrlCreateIcon("shell32.dll", $iIcon, 10, $iT + $iGap, 16, 16) GUICtrlCreateIcon($iIcon, -1, 10, $iT + $iGap, 16, 16) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) $iGap += 22 Return $hLink EndFunc ;==>_AddNewLink Func _AddNewPanel($sTxt) Local $gui = GUICreate("", $iW - $iLeftWidth + 2, $iH - $iT - $iB, $iLeftWidth + 2, $iT, $WS_CHILD + $WS_VISIBLE, -1, $hMainGUI) GUICtrlCreateLabel($sTxt, 10, 10, $iW - $iLeftWidth - 20, 17, $SS_CENTERIMAGE) GUICtrlSetFont(-1, 9, 800, 4, "Georgia", 5) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Return $gui EndFunc ;==>_AddNewPanel Func _AddControlsToPanel($hPanel) GUISwitch($hPanel) EndFunc ;==>_AddControlsToPanel Func DownloadSpeed() SplashTextOn("Wait", "Download speed test running...", 300, 50) Local $Download = "http://bitdefender.com/tv" Local $TempFile = @TempDir & "\Temp.temp" $Size = InetGetSize($Download) If $Size = 0 Then Return "(Not Connected)" $Time = TimerInit() $Success = InetGet($Download, $TempFile, 1, 0) If $Success = 0 Then Return "(Not Connected)" $Time = TimerDiff($Time) $Rate = ($Size / $Time) FileDelete($TempFile) SpashOff() Return Round($Rate) & " KB/s" EndFunc