Jump to content

Looking for something to use as back button and replacement for self restart


Go to solution Solved by JohnOne,

Recommended Posts

I am not a programmer and am fairly new to AutoIT.

I am creating a "kiosk" of sorts that sits at the front door to an office and allows guests to request assistance from a specific department by pressing a button on the touch screen and entering their name.  A picture of the person is taken and an email is sent to the department.  Currently once someone has completed entering their name and submitting their request I am using the self restart function from UP_NORTH to get back to the first screen so the next person can make a request.  While this works, it is not an ideal way to do this with the screen flickering from closing and opening the file again.  What I am hoping to do is find a way that I can get back to the start screen when someone is done in a clean manner.  Along with that I am trying to implement a button to allow them to go back to the start screen and select a different department to ask for assistance from if they selected the wrong one initially.  I have tried hiding/showing the different screens, but when I hide the start screen and go back, none of the buttons work.  In the code I'm posting, I have tried making the main screen it's own function and calling it at the different points I would need to return to the start screen, but when I try to go back it just exits the program all together.  Any help that could be offered would be greatly appreciated.

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Fileversion=2.0.0.1
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****



_MainScreen()

Func _MainScreen()
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

If Not FileExists("C:\Mailprog") Then
    DirCreate("C:\Mailprog")
    Sleep(2000)
    FileInstall("Mailprog.exe", "C:\Mailprog\")
    FileInstall("libeay32.dll", "C:\Mailprog\")
    FileInstall("libssl32.dll", "C:\Mailprog\")
EndIf
If Not FileExists("C:\front-door-gui-header.bmp") Then
    FileInstall("front-door-gui-header.bmp", "C:\front-door-gui-header.bmp")
EndIf
If Not FileExists(@DesktopDir & "\CamProg.exe") Then
    FileInstall("CamProg.exe", @DesktopDir & "\CamProg.exe")
EndIf


#region ### START Koda GUI section ###
$My_Door_Monitor_1 = GUICreate("My_Door_Monitor", 769, 1367, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP), 0)
GUISetBkColor(0x000000)
$lblExecutive_dept = GUICtrlCreateButton("Executive Department", 50, 232, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
$lblHeader = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
$lblNOC = GUICtrlCreateButton("Network Operations Center", 50, 381, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
$lblEngineering = GUICtrlCreateButton("Engineering", 50, 529, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
$lblManagedData = GUICtrlCreateButton("Managed Data Services", 50, 677, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
$lblAccounting = GUICtrlCreateButton("Accounting", 50, 826, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
$lblIT = GUICtrlCreateButton("Information Technology", 50, 975, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
$lblHR = GUICtrlCreateButton("Human Resources", 51, 1123, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
$lblMy = GUICtrlCreateLabel("Company Name", 288, 1288, 192, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$lblWelcome = GUICtrlCreateLabel("Welcome to My Company.  Please select a department", 45, 136, 678, 35)
GUICtrlSetFont(-1, 20, 400, 0, "Times New Roman")
GUICtrlSetColor(-1, 0xFFFFFF)
$lblRequest = GUICtrlCreateLabel("to request assistance.", 268, 176, 233, 35)
GUICtrlSetFont(-1, 20, 400, 0, "Times New Roman")
GUICtrlSetColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $lblExecutive_dept
            Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
            _Executive()
            _SelfRestart()
            FileDelete(@DesktopDir & "\image.bmp")

        Case $lblNOC
            Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
            _NOC()
            _SelfRestart()
            FileDelete(@DesktopDir & "\image.bmp")

        Case $lblEngineering
            Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
            _Engineering()
            _SelfRestart()
            FileDelete(@DesktopDir & "\image.bmp")

        Case $lblManagedData
            Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
            _MDS()
            _SelfRestart()
            FileDelete(@DesktopDir & "\image.bmp")

        Case $lblAccounting
            Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
            _Accounting()
            _SelfRestart()
            FileDelete(@DesktopDir & "\image.bmp")

        Case $lblIT
            Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
            _IT()
            _SelfRestart()
            FileDelete(@DesktopDir & "\image.bmp")

        Case $lblHR
            Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
            _HR()
            _SelfRestart()
            FileDelete(@DesktopDir & "\image.bmp")


    EndSwitch
WEnd
GUISetState(@SW_HIDE)
EndFunc   ;==>_MainScreen


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

Func _Executive()
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Executive department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Executive Department for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                _MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_Executive

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

Func _NOC()
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Network Operations Center.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from NOC for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                _MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_NOC

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

Func _Engineering()
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Engineering Department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Engineering for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                _MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_Engineering

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

Func _MDS()
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from Managed Data Services.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from MDS for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                _MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_MDS

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

Func _Accounting()
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Accounting department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Accounting for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                _MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_Accounting

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

Func _IT()
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Information Technology department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from IT for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                _MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_IT

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

Func _HR()
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Human Resources department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from HR for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        ;test mail command below
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                _MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_HR

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

Func _SelfRestart() ; restart the app credit to Author UP_NORTH
    ; Local $iMsgBoxAnswer = MsgBox(308, "Restarting...", "Are you sure you want to restart?")
    ; If $iMsgBoxAnswer <> 6
    ;Then Return
    ; Not Yes so return
    If @Compiled Then
        Run(FileGetShortName(@ScriptFullPath))
    Else
        Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc   ;==>_SelfRestart
Link to comment
Share on other sites

The Answer is "Return"

I've commented out some stuff to run on my machine and altered functions.

In fact you don't even need return, just remove selfrestart altogether.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
;#AutoIt3Wrapper_Res_Fileversion=2.0.0.1
;#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>


_MainScreen()

Func _MainScreen()
#cs
    If Not FileExists("C:\Mailprog") Then
        DirCreate("C:\Mailprog")
        Sleep(2000)
        FileInstall("Mailprog.exe", "C:\Mailprog\")
        FileInstall("libeay32.dll", "C:\Mailprog\")
        FileInstall("libssl32.dll", "C:\Mailprog\")
    EndIf
    If Not FileExists("C:\front-door-gui-header.bmp") Then
        FileInstall("front-door-gui-header.bmp", "C:\front-door-gui-header.bmp")
    EndIf
    If Not FileExists(@DesktopDir & "\CamProg.exe") Then
        FileInstall("CamProg.exe", @DesktopDir & "\CamProg.exe")
    EndIf
#ce

    #Region ### START Koda GUI section ###
    $My_Door_Monitor_1 = GUICreate("My_Door_Monitor", 769, 1367, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP), 0)
    GUISetBkColor(0x000000)
    $lblExecutive_dept = GUICtrlCreateButton("Executive Department", 50, 232, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblHeader = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    $lblNOC = GUICtrlCreateButton("Network Operations Center", 50, 381, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblEngineering = GUICtrlCreateButton("Engineering", 50, 529, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblManagedData = GUICtrlCreateButton("Managed Data Services", 50, 677, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblAccounting = GUICtrlCreateButton("Accounting", 50, 826, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblIT = GUICtrlCreateButton("Information Technology", 50, 975, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblHR = GUICtrlCreateButton("Human Resources", 51, 1123, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblMy = GUICtrlCreateLabel("Company Name", 288, 1288, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblWelcome = GUICtrlCreateLabel("Welcome to My Company.  Please select a department", 45, 136, 678, 35)
    GUICtrlSetFont(-1, 20, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblRequest = GUICtrlCreateLabel("to request assistance.", 268, 176, 233, 35)
    GUICtrlSetFont(-1, 20, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit

            Case $lblExecutive_dept
                ;Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _Executive()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")

            Case $lblNOC
                ;Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _NOC()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")

            Case $lblEngineering
                ;Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _Engineering()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")

            Case $lblManagedData
                ;Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _MDS()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")

            Case $lblAccounting
                ;Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _Accounting()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")

            Case $lblIT
                ;Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _IT()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")

            Case $lblHR
                ;Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _HR()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")


        EndSwitch
    WEnd
    GUISetState(@SW_HIDE)
EndFunc   ;==>_MainScreen


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

Func _Executive()
    MsgBox(0,0,0)
    Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Executive department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Executive Department for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_Executive

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

Func _NOC()
    MsgBox(0,0,0)
    Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Network Operations Center.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from NOC for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_NOC

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

Func _Engineering()
    MsgBox(0,0,0)
    Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Engineering Department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Engineering for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_Engineering

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

Func _MDS()
    MsgBox(0,0,0)
    Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from Managed Data Services.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from MDS for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_MDS

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

Func _Accounting()
    MsgBox(0,0,0)
    Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Accounting department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Accounting for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_Accounting

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

Func _IT()
    MsgBox(0,0,0)
    Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Information Technology department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from IT for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_IT

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

Func _HR()
    MsgBox(0,0,0)
    Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Human Resources department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from HR for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        ;test mail command below
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                ;_MainScreen()
                Return

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
EndFunc   ;==>_HR

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

Func _SelfRestart() ; restart the app credit to Author UP_NORTH
    ; Local $iMsgBoxAnswer = MsgBox(308, "Restarting...", "Are you sure you want to restart?")
    ; If $iMsgBoxAnswer <> 6
    ;Then Return
    ; Not Yes so return
    If @Compiled Then
        Run(FileGetShortName(@ScriptFullPath))
    Else
        Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc   ;==>_SelfRestart

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I may be going about this wrong, but using one function to narrow down the testing "_Executive".  I commented out the MsgBox and Return you had at the beginning and added it to the end of the function.  When I click the button to select the executive department, it opens the second screen, when I hit submit to send the message it moves to the "Thank You" screen and does not change from there.  Should I be putting the Return elsewhere in the function?  As far as for the department change button, would I just put return in the case statement?  Thank you very much for helping me with this.

Func _Executive()
    ;MsgBox(0,0,0)
    ;Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Executive department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Executive Department for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
               ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                ;GUIDelete
                Return 1



        EndSwitch

    WEnd
    Return
EndFunc   ;==>_Executive
Link to comment
Share on other sites

Ok, I figured out the Return part.  That works very well and I thank you very much.  The issue I have now when using it is that once I'm back on the start screen, when I select any department other than the one I originally selected, nothing happens and if I select the Executive department again, the program exits.  Below shows how I added the Returns.

While 1

        Local $subject = '"' & "Assistance requested from Executive Department for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

                Case $btnDeptChange
                    Return _MainScreen()
               ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                GUIDelete($My_Door_Monitor)
                Return _MainScreen()



        EndSwitch

    WEnd
EndFunc   ;==>_Executive
Link to comment
Share on other sites

Sorry, I forgot the error.  When I click the button for the executive department the second time I get the following error

C:Program Files (x86)AutoIt3IncludeEditConstants.au3 (13) : ==> Can not redeclare a constant.:
Global Const $ES_LEFT = 0
Global Const ^ ERROR

Link to comment
Share on other sites

  • Solution

Whenever you are finished in a function, just delete the gui you created in it GuiDelete() and Return from it with sole Return.

When you do this...

"Return _MainScreen()"  you are getting caught up in what's called recursion.

The Return keyword is not something you direct your function to return to, but rather you are telling your function to complete/finish/end.

it returns from that function and continues from wherever it was called from.

Your error with redeclaring consts is because you have #includes in your functions.

Remove them all and just include them once and the top of your script outside of any functions.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I removed the includes from the functions.  Thank you for that, I was under the impression I had to have them in each one.  I changed the Return entries and removed the specific function name from behind them and added the GUIDelete to each function.  When I click on a department on the first screen, the second screen opens and if I click the change department button the GUI goes away and the script stays running, when I click the submit button, it runs through to the thank you screen then the GUI goes away and the script keeps running.  So the GUIDelete appears to be working, but it's not returning to the main screen.  Below is the full script with the edits(I think I did them correctly).

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
;#AutoIt3Wrapper_Res_Fileversion=2.0.0.1
;#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>


_MainScreen()

Func _MainScreen()
#cs
    If Not FileExists("C:\Mailprog") Then
        DirCreate("C:\Mailprog")
        Sleep(2000)
        FileInstall("Mailprog.exe", "C:\Mailprog\")
        FileInstall("libeay32.dll", "C:\Mailprog\")
        FileInstall("libssl32.dll", "C:\Mailprog\")
    EndIf
    If Not FileExists("C:\front-door-gui-header.bmp") Then
        FileInstall("front-door-gui-header.bmp", "C:\front-door-gui-header.bmp")
    EndIf
    If Not FileExists(@DesktopDir & "\CamProg.exe") Then
        FileInstall("CamProg.exe", @DesktopDir & "\CamProg.exe")
    EndIf
#ce

    #Region ### START Koda GUI section ###
    $My_Door_Monitor_1 = GUICreate("My_Door_Monitor", 769, 1367, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP), 0)
    GUISetBkColor(0x000000)
    $lblExecutive_dept = GUICtrlCreateButton("Executive Department", 50, 232, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblHeader = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    $lblNOC = GUICtrlCreateButton("Network Operations Center", 50, 381, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblEngineering = GUICtrlCreateButton("Engineering", 50, 529, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblManagedData = GUICtrlCreateButton("Managed Data Services", 50, 677, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblAccounting = GUICtrlCreateButton("Accounting", 50, 826, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblIT = GUICtrlCreateButton("Information Technology", 50, 975, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblHR = GUICtrlCreateButton("Human Resources", 51, 1123, 668, 125, BitOR($BS_DEFPUSHBUTTON, $BS_NOTIFY))
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    $lblMy = GUICtrlCreateLabel("Company Name", 288, 1288, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblWelcome = GUICtrlCreateLabel("Welcome to My Company.  Please select a department", 45, 136, 678, 35)
    GUICtrlSetFont(-1, 20, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblRequest = GUICtrlCreateLabel("to request assistance.", 268, 176, 233, 35)
    GUICtrlSetFont(-1, 20, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit

            Case $lblExecutive_dept
                Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _Executive()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")
                GUIDelete($My_Door_Monitor_1)

            Case $lblNOC
                Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _NOC()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")
                GUIDelete($My_Door_Monitor_1)

            Case $lblEngineering
                Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _Engineering()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")
                GUIDelete($My_Door_Monitor_1)

            Case $lblManagedData
                Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _MDS()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")
                GUIDelete($My_Door_Monitor_1)

            Case $lblAccounting
                Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _Accounting()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")
                GUIDelete($My_Door_Monitor_1)

            Case $lblIT
                Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _IT()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")
                GUIDelete($My_Door_Monitor_1)

            Case $lblHR
                Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)
                _HR()
                ;_SelfRestart()
                FileDelete(@DesktopDir & "\image.bmp")
                GUIDelete($My_Door_Monitor_1)


        EndSwitch
    WEnd

EndFunc   ;==>_MainScreen


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

Func _Executive()
    ;MsgBox(0,0,0)
    ;Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)

    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Executive department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Executive Department for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                    GUIDelete($My_Door_Monitor)
                    Return
                    ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                GUIDelete($My_Door_Monitor)
                Return




        EndSwitch

    WEnd
EndFunc   ;==>_Executive

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

Func _NOC()
    ;MsgBox(0,0,0)

    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)

    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Network Operations Center.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from NOC for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                GUIDelete($My_Door_Monitor)
                Return
                ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                GUIDelete($My_Door_Monitor)
                Return




        EndSwitch

    WEnd
EndFunc   ;==>_NOC

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

Func _Engineering()
   ; MsgBox(0,0,0)
    ;Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)

    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Engineering Department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Engineering for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                GUIDelete($My_Door_Monitor)
                Return
                ;_MainScreen()

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                GUIDelete($My_Door_Monitor)
                Return



        EndSwitch

    WEnd
EndFunc   ;==>_Engineering

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

Func _MDS()
    ;MsgBox(0,0,0)
    ;Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)

    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from Managed Data Services.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from MDS for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                GUIDelete($My_Door_Monitor)
                Return

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                GUIDelete($My_Door_Monitor)
                Return



        EndSwitch

    WEnd
EndFunc   ;==>_MDS

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

Func _Accounting()
    ;MsgBox(0,0,0)
    ;Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)

    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Accounting department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from Accounting for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                GUIDelete($My_Door_Monitor)
                Return

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                GUIDelete($My_Door_Monitor)
                Return



        EndSwitch

    WEnd
EndFunc   ;==>_Accounting

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

Func _IT()
    ;MsgBox(0,0,0)
    ;Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)

    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Information Technology department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from IT for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                GUIDelete($My_Door_Monitor)
                Return

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                GUIDelete($My_Door_Monitor)
                Return



        EndSwitch

    WEnd
EndFunc   ;==>_IT

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

Func _HR()
    ;MsgBox(0,0,0)
    ;Return
    Run(@DesktopDir & "\CamProg.exe", "", @SW_HIDE)

    #Region ### START Koda GUI section ### Form=
    $My_Door_Monitor = GUICreate("My_Door_Monitor", 771, 1369, -1, -1)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\front-door-gui-header.bmp", 155, 8, 459, 122)
    ;Name Screen Items------------------------------------------------------------------------------------------------------------
    $lblDeptRequest = GUICtrlCreateLabel("You are requesting assistance from the Human Resources department.", 107, 160, 557, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $btnDeptChange = GUICtrlCreateButton("Change Department", 256, 192, 259, 41)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $lblName = GUICtrlCreateLabel("Tap in the white box below and enter your name", 73, 336, 622, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName2 = GUICtrlCreateLabel("with the keyboard on the screen, then click the", 89, 371, 590, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblName3 = GUICtrlCreateLabel('"' & "Submit" & '"' & " " & "button to request assistance.", 145, 407, 478, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $lblYourName = GUICtrlCreateLabel("Your Name:", 50, 496, 88, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $txtName = GUICtrlCreateInput("", 50, 520, 668, 44)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    $btnSubmit = GUICtrlCreateButton("Submit", 50, 640, 668, 125)
    GUICtrlSetFont(-1, 28, 400, 0, "Arial Narrow")
    ;Thank You Screen Items-------------------------------------------------------------------------------------------------------
    $lblThankyou = GUICtrlCreateLabel("Thank you.", 312, 328, 145, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    $lblShortly = GUICtrlCreateLabel("Someone will be with you shortly.", 166, 400, 436, 40)
    GUICtrlSetFont(-1, 24, 400, 0, "Times New Roman")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_HIDE)
    ;-----------------------------------------------------------------------------------------------------------------------
    $lblMy = GUICtrlCreateLabel("My Company", 320, 1272, 192, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    ShellExecute(@ProgramFilesDir & "\Common Files\microsoft shared\ink\TabTip.exe")

    While 1

        Local $subject = '"' & "Assistance requested from HR for " & GUICtrlRead($txtName) & '"'
        Local $file = @DesktopDir & "\image.bmp"
        ;test mail command below
        Local $command2 = "C:\mailprog.exe"
        Local $CustomerName = GUICtrlRead($txtName)

        $nMsg2 = GUIGetMsg()
        Switch $nMsg2
            ;Case $GUI_EVENT_CLOSE
            ;Exit

            Case $btnDeptChange
                GUIDelete($My_Door_Monitor)
                Return

            Case $btnSubmit
                ProcessClose("TabTip.exe")
                Run(@ComSpec & " /c " & $command2, "", @SW_HIDE)
                GUICtrlSetState($lblName, $GUI_HIDE)
                GUICtrlSetState($lblName2, $GUI_HIDE)
                GUICtrlSetState($lblName3, $GUI_HIDE)
                GUICtrlSetState($txtName, $GUI_HIDE)
                ;GUICtrlSetState($txtCompanyName, $GUI_HIDE)
                GUICtrlSetState($lblYourName, $GUI_HIDE)
                ;GUICtrlSetState($lblCompanyName, $GUI_HIDE)
                ;GUICtrlSetState($lblPressEnter, $GUI_HIDE)
                GUICtrlSetState($btnSubmit, $GUI_HIDE)
                GUICtrlSetState($lblThankyou, $GUI_SHOW)
                GUICtrlSetState($lblShortly, $GUI_SHOW)
                Sleep(5000)
                GUIDelete($My_Door_Monitor)
                Return



        EndSwitch

    WEnd
EndFunc   ;==>_HR

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

Func _SelfRestart() ; restart the app credit to Author UP_NORTH
    ; Local $iMsgBoxAnswer = MsgBox(308, "Restarting...", "Are you sure you want to restart?")
    ; If $iMsgBoxAnswer <> 6
    ;Then Return
    ; Not Yes so return
    If @Compiled Then
        Run(FileGetShortName(@ScriptFullPath))
    Else
        Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc   ;==>_SelfRestart
Link to comment
Share on other sites

I think I figured it out.  The issue I had before was because I had a GUIDelete for the main screen in the case statement for each button.  I took that out and it appears to be working well.  I will test a bit more.  Thank you VERY much for all of your help.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...