Jump to content
Sign in to follow this  
iamtheky

Questionnaire - GUI example

Recommended Posts

iamtheky

This is a working model of the customer onboarding questionnaire I am building for my company.  This example is based wholly off Taietel's GUI example here: , and since it is 80+ percent his i figured it kind to return it to the pond.

This shows how to make a decent questionnaire and some different formats you can return and persist data.  Instead of a paper drill, its a 5 minute walk through an application, And potentially the chance to cook off a scan or two on their network and get 10's of pages of useful factual data rather than a CISOs guess.

All recommendations and criticisms are welcome, things i build can only improve.

----

Instructions is just an edit control

 

Node Count shows use of the single function i added to create a panel with two sections split horizontally.  All controls have their values stored in an ini file used so selections persist as the app is opened and closed. As well, they output on button click to an excel spreadsheet that does some math to provide useful data to the customer (in this case its estimated EPS), this just got polished with jdelaney's fix so that when you click in the input box the existing contents are selected (and then overwritten when you type).

operations and network are mostly radio buttons, the controls that were selected are saved in the ini and will persist.  There are no checks on the edit boxes at the bottom of either of these panels and the string that is in that box will persist.

Utilities is a bunch of buttons, well not yet, but it will be.  They will run specific commands / arguments and output logs.

----

#AutoIt3Wrapper_Res_File_Add=logo_banner_45h_600w.bmp, rt_bitmap, TEST_BMP_1

#include <GuiConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Array.au3>
#include <ColorConstants.au3>
#include <GUIConstantsEx.au3>
#include <Excel.au3>
#include <resources.au3>
#include <GuiEdit.au3>


#region GLOBAL VARIABLES
Global $ver = "v07"

Global $iW = 600, $iH = 400, $iT = 52, $iB = 52, $iLeftWidth = 150, $iGap = 10, $hMainGUI , $aSection , $hEditP31 , $hEditP32 , $hEditP4 , $focus="", $last = ""

Global $INIfile = @ScriptDir & "\" & $ver & "Customer.ini"

#endregion GLOBAL VARIABLES

    If fileexists(@ScriptDir & "\" & $ver & "Customer.xls") Then
        $objExcel = _ExcelBookOpen(@ScriptDir & "\" & $ver & "Customer.xls" , 0)
    Else
        $objExcel = _ExcelBookNew(0)

        _ExcelWriteCell($objExcel , "---SERVERS---" , 2 , 1)
        _ExcelWriteCell($objExcel , "DCs" , 3 , 1)
            _ExcelWriteCell ( $objExcel, "=B3*35", 3 , 3 )
        _ExcelWriteCell($objExcel , "Proxy" , 4 , 1)
            _ExcelWriteCell ( $objExcel, "=B4*5", 4 , 3 )
        _ExcelWriteCell($objExcel , "Database" , 5 , 1)
            _ExcelWriteCell ( $objExcel, "=B5*4", 5 , 3 )
        _ExcelWriteCell($objExcel , "VM" , 6 , 1)
            _ExcelWriteCell ( $objExcel, "=B6*8", 6 , 3 )
        _ExcelWriteCell($objExcel , "VPN" , 7 , 1)
            _ExcelWriteCell ( $objExcel, "=B7*5", 7 , 3 )
        _ExcelWriteCell($objExcel , "Small" , 8 , 1)
            _ExcelWriteCell ( $objExcel, "=B8*5", 8 , 3 )
        _ExcelWriteCell($objExcel , "Medium" , 9 , 1)
            _ExcelWriteCell ( $objExcel, "=B9*15", 9 , 3 )
        _ExcelWriteCell($objExcel , "Large" , 10 , 1)
            _ExcelWriteCell ( $objExcel, "=B10*30", 10 , 3 )

        _ExcelWriteCell($objExcel , "---DEVICES---" , 12 , 1)
        _ExcelWriteCell($objExcel , "Routers" , 13 , 1)
            _ExcelWriteCell ( $objExcel, "=B13*10", 13 , 3 )
        _ExcelWriteCell($objExcel , "Switches" , 14 , 1)
            _ExcelWriteCell ( $objExcel, "=B14*150", 14 , 3 )
        _ExcelWriteCell($objExcel , "IDS /IPS" , 15 , 1)
            _ExcelWriteCell ( $objExcel, "=B15*70", 15 , 3 )
        _ExcelWriteCell($objExcel , "NAS" , 16 , 1)
            _ExcelWriteCell ( $objExcel, "=B16*7", 16 , 3 )
        _ExcelWriteCell($objExcel , "Firewalls" , 17 , 1)
            _ExcelWriteCell ( $objExcel, "=B17*35", 17 , 3 )
        _ExcelWriteCell($objExcel , "Small" , 18 , 1)
            _ExcelWriteCell ( $objExcel, "=B18*5", 18 , 3 )
        _ExcelWriteCell($objExcel , "Medium" , 19 , 1)
            _ExcelWriteCell ( $objExcel, "=B19*15", 19 , 3 )
        _ExcelWriteCell($objExcel , "Large" , 20 , 1)
            _ExcelWriteCell ( $objExcel, "=B20*30", 20 , 3 )


_ExcelWriteCell ( $objExcel, "=SUM(C3:C20)", 22 , 3 )
_ExcelWriteCell ( $objExcel, "Events Per Second", 22 , 4 )

_ExcelFontSetProperties ( $objExcel, 2 , 1 , 2 , 1 , True , False , False)
_ExcelFontSetProperties ( $objExcel, 12 , 1 , 12 , 1 , True , False , False)
_ExcelFontSetProperties ( $objExcel, 22 , 3 , 22 , 4 , True , False , False)


        _ExcelBookSaveAs($objExcel, @ScriptDir & "\" & $ver & "Customer", "xls")


    Endif





_MainGui()


Func _MainGui()



Local $hFooter, $nMsg, $aPos
Local $iLinks = 6
Local $sMainGuiTitle = "Cybersalus"
Local $sHeader = "Cybersalus Customer Snapshot"
Local $sFooter = "2014 Cybersalus, LLC"
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", -140, $hMainGUI)

$hFooter = GUICtrlCreatePic("", 10, $iH - 48, $iW - 20, 40)
GUICtrlSetTip(-1, "cybersalus.com", "Click to open...")
GUICtrlSetCursor(-1, 0)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

$hBmp = _ResourceGet("TEST_BMP_1", $RT_BITMAP)
; and use it for whatever you like
_SetBitmapToCtrl($hfooter, $hBmp)


;~ $hPanelPic = GUICtrlCreatePic("C:\Users\Ky\Pictures\angled_screen_gray300.gif", 2, $iH - 185, 145, 130)


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", -140, 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, 110, 17, BitOR($SS_LEFT, $SS_CENTERIMAGE))
;~ GUICtrlSetTip(-1, "cybersalus.com", "Click to open...")
;~ GUICtrlSetCursor(-1, 0)
;~ GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)

;add links to the left side
$aLink[1] = _AddNewLink("Instructions")
$aLink[2] = _AddNewLink("Node Count", -85)
$aLink[3] = _AddNewLink("Operations", -208)
$aLink[4] = _AddNewLink("Network", -165)
$aLink[5] = _AddNewLink("Utilities", -12)
;and the corresponding GUI's
$aPanel[1] = _AddNewPanel("Instructions")
$aPanel[2] = _AddNewPanelSplit("Server Count" , "Device Count")
$aPanel[3] = _AddNewPanel("Operations")
$aPanel[4] = _AddNewPanel("Network")
$aPanel[5] = _AddNewPanel("Automated Queries")

;add some controls to the panels
_AddControlsToPanel($aPanel[1])
GUICtrlCreateEdit("", 10, 37, $iW - $iLeftWidth + 2 - 20 - 5, $iH - $iT - $iB - 40, BitOR($ES_AUTOVSCROLL, $ES_NOHIDESEL, $ES_WANTRETURN, $WS_VSCROLL), $WS_EX_STATICEDGE)
Local $sTestTxt = ""
$sTestTxt &= "This quick questionnaire will provide us with the intial data necessary to begin the onboarding process as a customer of Cybersalus. " & @CRLF & @CRLF & _
             "The purpose of the questions is to estimate the resources necessary for service levels catered to your operation. " & _
             "There are also utilities that will allow us to gain a clearer picture of the environment and provide you a more accurate assessment." & @CRLF & @CRLF & _
             @TAB & @TAB & @TAB & "On the Node Count Pane: " & @CRLF & @CRLF & _
             "- Please provide a value (and 0 is a perfectly acceptable value) for all available fields. " & @CRLF & _
             "- Please account for all unspecified systems in the 'Generic Sm/Md/Lg' categories."


GUICtrlSetData(-1, $sTestTxt)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM)

;--------------------------------------------------------------------------------------------------------------------------------------------------------------------

_AddControlsToPanel($aPanel[2])

;---top left

GUICtrlCreateLabel("Domain Controllers", 8, 38, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput21 = GUICtrlCreateInput(iniread($INIfile, "Server Count" , "DCs" , "#"), 105, 34, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hButton21 = GUICtrlCreateButton("Update Servers", 335, 78, 95, 25)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("Utility/Proxy", 8, 68, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput22 = GUICtrlCreateInput(iniread($INIfile , "Server Count" , "Utility" , "#"), 105, 64, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton22 = GUICtrlCreateButton("Update", 205, 71, 75, 25)
;~ GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("Database Servers", 8, 98, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput23 = GUICtrlCreateInput(iniread($INIfile , "Server Count" , "DBs" , "#"), 105, 95, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton23 = GUICtrlCreateButton("Update", 205, 112, 75, 25)
;~ GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("VM / HighUse", 8, 128, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput24 = GUICtrlCreateInput(iniread($INIfile , "Server Count" , "HighUse" , "#"), 105, 126, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton24 = GUICtrlCreateButton("Update", 205, 181, 75, 25)
;~ GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)


;-----top right



GUICtrlCreateLabel("VPN / Remote", 160, 38, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput25 = GUICtrlCreateInput(iniread($INIfile , "Server Count" , "VPN" , "#"), 280, 34, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton25 = GUICtrlCreateButton("Update", 205, 221, 75, 25)
;~ GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("Generic - Sm", 160, 68, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput26 = GUICtrlCreateInput(iniread($INIfile , "Server Count" , "Small" , "#"), 280, 64, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton26 = GUICtrlCreateButton("Update", 205, 261, 75, 25)
;~ GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("Generic - Md", 160, 98, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput27 = GUICtrlCreateInput(iniread($INIfile , "Server Count" , "Medium" , "#"), 280, 94, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("Generic - Lg", 160, 128, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput28 = GUICtrlCreateInput(iniread($INIfile , "Server Count" , "Large" , "#"), 280, 124, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)


;----bottom panel left DEVICES

GUICtrlCreateLabel("Routers", 8, 180, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput29 = GUICtrlCreateInput(iniread($INIfile , "Device Count" , "Routers" , "#"), 105, 176, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hButton22 = GUICtrlCreateButton("Update Devices", 335, 216, 95, 25)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("Switches", 8, 210, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput30 = GUICtrlCreateInput(iniread($INIfile , "Device Count" , "Switches" , "#"), 105, 206, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton22 = GUICtrlCreateButton("Update", 205, 71, 75, 25)
;~ GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("IPS / IDS", 8, 240, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput31 = GUICtrlCreateInput(iniread($INIfile , "Device Count" , "IPSIDS" , "#"), 105, 236, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton23 = GUICtrlCreateButton("Update", 205, 112, 75, 25)
;~ GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("NAS", 8, 270, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput32 = GUICtrlCreateInput(iniread($INIfile , "Device Count" , "NAS" , "#"), 105, 266, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton24 = GUICtrlCreateButton("Update", 205, 181, 75, 25)

;bottom right

GUICtrlCreateLabel("Firewalls", 160, 180, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput33 = GUICtrlCreateInput(iniread($INIfile , "Device Count" , "Firewalls" , "#"), 280, 176, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton25 = GUICtrlCreateButton("Update", 205, 221, 75, 25)
;~ GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("Generic - Sm", 160, 210, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput34 = GUICtrlCreateInput(iniread($INIfile , "Device Count" , "Small" , "#"), 280, 206, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;~ Local $hButton26 = GUICtrlCreateButton("Update", 205, 261, 75, 25)
;~ GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("Generic - Md", 160, 240, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput35 = GUICtrlCreateInput(iniread($INIfile , "Device Count" , "Medium" , "#"), 280, 236, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateLabel("Generic - Lg", 160, 270, 106, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $hInput36 = GUICtrlCreateInput(iniread($INIfile , "Device Count" , "Large" , "#"), 280, 266, 33, 21)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;--------------------------------------------------------------------------------------------------------------------------------------------------------------------

_AddControlsToPanel($aPanel[3])
GUICtrlCreateGroup("Manage your own IT?", 8, 40, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio31[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio31[$i] = GUICtrlCreateRadio($string, 16, 56 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Operations" , "Question 1" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)


GUICtrlCreateGroup("Recent Security Events?", 148, 40, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio32[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio32[$i] = GUICtrlCreateRadio($string, 156, 56 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Operations" , "Question 2" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)


GUICtrlCreateGroup("Actively Managed Firewall?", 288, 40, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio33[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio33[$i] = GUICtrlCreateRadio($string, 296, 56 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Operations" , "Question 3" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
;------Second row

GUICtrlCreateGroup("All endpoints Windows?", 8, 150, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio34[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio34[$i] = GUICtrlCreateRadio($string, 16, 166 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Operations" , "Question 4" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)

GUICtrlCreateGroup("Routine system patching?", 148, 150, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio35[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio35[$i] = GUICtrlCreateRadio($string, 156, 166 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Operations" , "Question 5" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)

GUICtrlCreateGroup("Endpoint solution interest?", 288, 150, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio36[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio36[$i] = GUICtrlCreateRadio($string, 296, 166 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Operations" , "Question 6" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)

;-----third row


GUICtrlCreateLabel("NTP:", 8, 257, 30, 17)
$hEditP31 = GUICtrlCreateEdit("", 40, 255, 97, 18, BitOR($ES_AUTOVSCROLL, $ES_NOHIDESEL, $ES_WANTRETURN), $WS_EX_STATICEDGE)
Local $sTestTxt = ""
$sTestTxt &=  "192.168.0.0"
GUICtrlSetData(-1, iniread($INIfile , "Expanded" , "Panel31" , $sTestTxt))
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM)

GUICtrlCreateLabel("DNS:", 148, 257, 30, 17)
$hEditP32 = GUICtrlCreateEdit("", 180, 255, 97, 18, BitOR($ES_AUTOVSCROLL, $ES_NOHIDESEL, $ES_WANTRETURN), $WS_EX_STATICEDGE)
Local $sTestTxt = ""
$sTestTxt &=  "192.168.0.0"
GUICtrlSetData(-1, iniread($INIfile , "Expanded" , "Panel32" , $sTestTxt))
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM)

Local $hButton31 = GUICtrlCreateButton("Save", 315, 252, 75, 25)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

;--------------------------------------------------------------------------------------------------------------------------------------------------------------------

_AddControlsToPanel($aPanel[4])
GUICtrlCreateGroup("Recent Network Outage", 8, 40, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio41[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio41[$i] = GUICtrlCreateRadio($string, 16, 56 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Network" , "Question 1" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)

GUICtrlCreateGroup("Multiple Network Providers", 148, 40, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio42[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio42[$i] = GUICtrlCreateRadio($string, 156, 56 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Network" , "Question 2" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)

GUICtrlCreateGroup("Backup Power (for Devices)", 288, 40, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio43[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio43[$i] = GUICtrlCreateRadio($string, 296, 56 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Network" , "Question 3" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)

;-----Second Line


GUICtrlCreateGroup("Current IDS/IPS?", 8, 150, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio44[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio44[$i] = GUICtrlCreateRadio($string, 16, 166 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Network" , "Question 4" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)

GUICtrlCreateGroup("Known Internal Risks?", 148, 150, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio45[4]
For $i = 1 To 3
If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio45[$i] = GUICtrlCreateRadio($string, 156, 166 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Network" , "Question 5" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)

GUICtrlCreateGroup("VLAN / Proxy", 288, 150, 129, 90)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Local $aRadio46[4]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
$aRadio46[$i] = GUICtrlCreateRadio($string, 296, 166 + ($i - 1) * 20, 113, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next
GUICtrlSetState(number(iniread($INIfile , "Network" , "Question 6" , -1)) , $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)

;------Third Line

$hEditP4 = GUICtrlCreateEdit("", 10, 245, 270, 45, BitOR($ES_AUTOVSCROLL, $ES_NOHIDESEL, $ES_WANTRETURN, $WS_VSCROLL), $WS_EX_STATICEDGE)
Local $sTestTxt = ""
$sTestTxt &= "Please use this space to identify any network devices that require special attention and/or elaborate on existing security risks and policy."
GUICtrlSetData(-1, iniread($INIfile , "Expanded" , "Panel4" , $sTestTxt))
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM)

Local $hButton41 = GUICtrlCreateButton("Save", 315, 252, 75, 25)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

;--------------------------------------------------------------------------------------------------------------------------------------------------------------------

_AddControlsToPanel($aPanel[5])

Local $hButton51 = GUICtrlCreateButton("Run NMAP", 10, 39, 75, 25)



GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
If iniread($INIfile , "Utilities" , "NMAP" , 0) = 1 Then
    GUICtrlCreateLabel("Complete", 92, 44, 70, 17)
    GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    GUICtrlSetColor(-1 , $COLOR_GREEN)
Else
    GUICtrlCreateLabel("Not Complete", 92, 45, 70, 17)
    GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    GUICtrlSetColor(-1 , $COLOR_RED)
Endif

Local $hButton52 = GUICtrlCreateButton("Run MBSA", 10, 73, 75, 25)

GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
If iniread($INIfile , "Utilities" , "MBSA" , 0) = 1 Then
    GUICtrlCreateLabel("Complete", 92, 78, 70, 17)
    GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    GUICtrlSetColor(-1 , $COLOR_GREEN)
Else
    GUICtrlCreateLabel("Not Complete", 92, 78, 70, 17)
    GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    GUICtrlSetColor(-1 , $COLOR_RED)
Endif


;--------------------------------------------------------------------------------------------------------------------------------------------------------------------

;set default to Panel1
GUISwitch($aPanel[1])
;show the main GUI
GUISetState(@SW_SHOW, $hMainGUI)

While 1
Sleep(10)
$nMsg = GUIGetMsg(1)

 $focus = String(ControlGetFocus($hMainGUI))
        If StringInStr($focus,"Edit") And $focus <> $last Then
            $last = $focus
            $h = ControlGetHandle($hMainGUI, "",$focus)
            _GUICtrlEdit_SetSel($h, 0, StringLen(ControlGetText($hMainGUI,"",$h)))
        EndIf

Switch $nMsg[1]
Case $hMainGUI
Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE

_exitNsave()

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], $aLink[5]
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("http://cybersalus.com")
EndSwitch

Case $aPanel[2]
Switch $nMsg[0]
    Case $hButton21

    iniwrite ($INIfile , "Server Count" , "DCs" , GUICtrlRead($hInput21))
    iniwrite ($INIfile , "Server Count" , "Utility" , GUICtrlRead($hInput22))
    iniwrite ($INIfile , "Server Count" , "DBs" , GUICtrlRead($hInput23))
    iniwrite ($INIfile , "Server Count" , "HighUse" , GUICtrlRead($hInput24))
    iniwrite ($INIfile , "Server Count" , "VPN" , GUICtrlRead($hInput25))
    iniwrite ($INIfile , "Server Count" , "Small" , GUICtrlRead($hInput26))
    iniwrite ($INIfile , "Server Count" , "Medium" , GUICtrlRead($hInput27))
    iniwrite ($INIfile , "Server Count" , "Large" , GUICtrlRead($hInput28))

    If GUICtrlRead($hInput21) = "#" Then
        _ExcelWriteCell($objExcel , 0 , 3 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput21) , 3 , 2)
    EndIf

    If GUICtrlRead($hInput22) = "#" Then
        _ExcelWriteCell($objExcel , 0 , 4 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput22) , 4 , 2)
    EndIf

    If GUICtrlRead($hInput23) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 5 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput23) , 5 , 2)
    EndIf

    If GUICtrlRead($hInput24) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 6 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput24) , 6 , 2)
    EndIf

    If GUICtrlRead($hInput25) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 7 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput25) , 7 , 2)
    EndIf

    If GUICtrlRead($hInput26) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 8 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput26) , 8 , 2)
    EndIf

    If GUICtrlRead($hInput27) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 9 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput27) , 9 , 2)
    EndIf

    If GUICtrlRead($hInput28) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 10 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput28) , 10 , 2)
    EndIf

    _ExcelBookSaveAs($objExcel, @ScriptDir & "\" & $ver & "Customer", "xls")


    Case $hButton22

        $aSection = IniReadSection($INIfile , "Network")
;~  _ArrayDisplay($aSection)

    iniwrite ($INIfile , "Device Count" , "Routers" , GUICtrlRead($hInput29))
    iniwrite ($INIfile , "Device Count" , "Switches" , GUICtrlRead($hInput30))
    iniwrite ($INIfile , "Device Count" , "IPSIDS" , GUICtrlRead($hInput31))
    iniwrite ($INIfile , "Device Count" , "NAS" , GUICtrlRead($hInput32))
    iniwrite ($INIfile , "Device Count" , "Firewalls" , GUICtrlRead($hInput33))
    iniwrite ($INIfile , "Device Count" , "Small" , GUICtrlRead($hInput34))
    iniwrite ($INIfile , "Device Count" , "Medium" , GUICtrlRead($hInput35))
    iniwrite ($INIfile , "Device Count" , "Large" , GUICtrlRead($hInput36))

    If GUICtrlRead($hInput29) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 13 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput29) , 13 , 2)
    EndIf

    If GUICtrlRead($hInput30) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 14 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput30) , 14 , 2)
    EndIf

    If GUICtrlRead($hInput31) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 15 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput31) , 15 , 2)
    EndIf

    If GUICtrlRead($hInput32) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 16 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput32) , 16 , 2)
    EndIf

    If GUICtrlRead($hInput33) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 17 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput33) , 17 , 2)
    EndIf

    If GUICtrlRead($hInput34) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 18 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput34) , 18 , 2)
    EndIf

    If GUICtrlRead($hInput35) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 19 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput35) , 19 , 2)
    EndIf

    If GUICtrlRead($hInput36) = "#" Then
    _ExcelWriteCell($objExcel , 0 , 20 , 2)
    Else
    _ExcelWriteCell($objExcel ,  GUICtrlRead($hInput36) , 20 , 2)
    Endif


    _ExcelBookSaveAs($objExcel, @ScriptDir & "\" & $ver & "Customer", "xls")



EndSwitch

Case $aPanel[3]
Switch $nMsg[0]


Case $aRadio31[1], $aRadio31[2], $aRadio31[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio31[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Operations" , "Question 1" , $aRadio31[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif


Next

Case $aRadio32[1], $aRadio32[2], $aRadio32[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio32[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Operations" , "Question 2" , $aRadio32[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif



Next

Case $aRadio33[1], $aRadio33[2], $aRadio33[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio33[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Operations" , "Question 3" , $aRadio33[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif


Next

Case $aRadio34[1], $aRadio34[2], $aRadio34[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio34[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Operations" , "Question 4" , $aRadio34[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif


Next

Case $aRadio35[1], $aRadio35[2], $aRadio35[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio35[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Operations" , "Question 5" , $aRadio35[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif


Next

Case $aRadio36[1], $aRadio36[2], $aRadio36[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio36[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Operations" , "Question 6" , $aRadio36[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif
Next

Case $hButton31

        iniwrite($INIfile , "Expanded" , "Panel31" , GuiCtrlRead($hEditP31))
        iniwrite($INIfile , "Expanded" , "Panel32" , GuiCtrlRead($hEditP32))

EndSwitch

Case $aPanel[4]
Switch $nMsg[0]

Case $aRadio41[1], $aRadio41[2], $aRadio41[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio41[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Network" , "Question 1" , $aRadio41[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif

    $aSection = IniReadSection($INIfile , "Network")
        If isarray($aSection) Then
If $aSection[0][0] = "7" Then
    iniwrite($INIfile , "Network" , "Complete" , "1")
Else
    iniwrite($INIfile , "Network" , "Complete" , "0")
Endif
Endif

Next

Case $aRadio42[1], $aRadio42[2], $aRadio42[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio42[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Network" , "Question 2" , $aRadio42[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif

    $aSection = IniReadSection($INIfile , "Network")
        If isarray($aSection) Then
If $aSection[0][0] = "7" Then
    iniwrite($INIfile , "Network" , "Complete" , "1")
Else
    iniwrite($INIfile , "Network" , "Complete" , "0")
Endif
Endif

Next

Case $aRadio43[1], $aRadio43[2], $aRadio43[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio43[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Network" , "Question 3" , $aRadio43[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif

Next

Case $aRadio44[1], $aRadio44[2], $aRadio44[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio44[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Network" , "Question 4" , $aRadio44[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif

Next

Case $aRadio45[1], $aRadio45[2], $aRadio45[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio45[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Network" , "Question 5" , $aRadio45[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif

Next

Case $aRadio46[1], $aRadio46[2], $aRadio46[3]
For $i = 1 To 3
    If $i = 1 Then $string = "Yes"
    If $i = 2 Then $string = "No"
    If $i = 3 Then $string = "Unknown"
If GUICtrlRead($aRadio46[$i]) = $GUI_CHECKED Then
iniwrite($INIfile , "Network" , "Question 6" , $aRadio46[$i])
;~ MsgBox(64, "Test", "You selected " & $string & " to - Recent Network Outages.")
Endif

Next

Case $hButton41

iniwrite($INIfile , "Expanded" , "Panel4" , GuiCtrlRead($hEditP4))

EndSwitch

Case $aPanel[5]
Switch $nMsg[0]
    Case $hButton51
        msgbox(0, '' , stringtrimright(@IPAddress1, 4))
        runwait("cmd /k nmap -sS -A -oN nmap_test.log " & @IPAddress1 & "/24")
        iniwrite ($INIfile , "Utilities" , "NMAP" , 1)
            _exitNsave()
        exit
    Case $hButton52
        msgbox(0, '' , "This will save and exit the questionnaire and run the Microsoft Baseline Seurity Analyzer.")
        iniwrite ($INIfile , "Utilities" , "MBSA" , 1)
            _exitNsave()
        exit
EndSwitch


EndSwitch
WEnd
EndFunc ;==>_MainGui

Func _AddNewLink($sTxt, $iIcon = -44)
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)
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, "Arial", 5)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Return $gui
EndFunc ;==>_AddNewPanel

Func _AddNewPanelSplit($sTxt1 , $sTxt2)
Local $gui = GUICreate("", $iW - $iLeftWidth + 2, $iH - $iT - $iB, $iLeftWidth + 2, $iT, $WS_CHILD + $WS_VISIBLE, -1, $hMainGUI)
GUICtrlCreateLabel($sTxt1, 120, 10, $iW - $iLeftWidth - 20, 17, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 9, 800, 4, "Arial", 5)
GUICtrlCreateLabel($sTxt2, 120, 152, $iW - $iLeftWidth - 20, 17, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 9, 800, 4, "Arial", 5)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Return $gui
EndFunc ;==>_AddNewPanel

Func _AddControlsToPanel($hPanel)
GUISwitch($hPanel)
EndFunc ;==>_AddControlsToPanel

Func _exitNsave()
        iniwrite($INIfile , "Expanded" , "Panel31" , GuiCtrlRead($hEditP31))
        iniwrite($INIfile , "Expanded" , "Panel32" , GuiCtrlRead($hEditP32))
        iniwrite($INIfile , "Expanded" , "Panel4" , GuiCtrlRead($hEditP4))
        _ExcelBookSaveAs($objExcel, @ScriptDir & "\" & $ver & "Customer", "xls")
        _ExcelBookClose($objExcel)
            exit
EndFunc
Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
stealthmsgr

boththose, I have a similar side project that I was wondering how to setup, this is promising to use much like you did. I will inquire with dmob.  resources.au3? Or am I/we missing something?

Share this post


Link to post
Share on other sites
iamtheky


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.