Jump to content

Running multiple GUI issue


Go to solution Solved by Jos,

Recommended Posts

Hello community.

So I have written a simple code to launch some web based applications and send me feedback if they are experiencing issues.

This runs off two GUI's and when I click the "page 2" button it launches the second gui. All is well until I try to close out the second gui. It then loops and launches the web based apps over and over again. This doesn't do it if I just close out the first GUI

Any ideas as to what I've done wrong here?

Much much thanks

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.1
 Author:         Ryan Bailey

 Script Function:
CS Application Launcher

#ce ----------------------------------------------------------------------------

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#include <IE.au3>
#include <Word.au3>
#include <excel.au3>
#include <ScreenCapture.au3>


opt("MustDeclareVar" , 1)

MainGUI()

;Name the Variables
Func MainGUI()
    Global  $gui2 , $hBmp , $SeondaryGUI ,  $Page2 , $hBmp , $Screen , $mygui , $newmsg , $Label3 , $Submit , $Edit , $Amysis , $CareManager , $CSA , $HealthX , $Kronos , $Google , $NCR , $NICEPerform , $NICEWFM , $MP , $ReportManager , $RXCLAIM
    Global  $RxPortal , $ie , $Calc , $Password ,$IE , $Button14 , $HFHPAPP , $Button16 , $Label1 , $Label2 ,$Notepad , $Word , $Excel , $Groupwise, $Messenger , $HFlogo , $Button21 , $Pic1 , $CSapps , $msg

;Create the main GUI

$mygui = GUICreate("Customer Service Omni-Tool", 514, 711, 258, 173)
GUISetCursor (2)
GUISetFont(10, 800, 0, "MS Sans Serif")
GUISetBkColor(0xA6CAF0)


;Assign the Variables
$Amysis = GUICtrlCreateButton("Amysis", 16, 72, 139, 25)
$CareManager = GUICtrlCreateButton("Care Manager", 16, 104, 139, 25)
$CSA = GUICtrlCreateButton("CSA", 16, 136, 139, 25)
$HealthX = GUICtrlCreateButton("Health X", 16, 168, 139, 25)
$Kronos = GUICtrlCreateButton("Kronos", 16, 200, 139, 25)
$Google = GUICtrlCreateButton("Google", 16, 232, 139, 25)
$NCR = GUICtrlCreateButton("NCR", 16, 264, 139, 25)
$NICEPerform = GUICtrlCreateButton("NICE Perform", 16, 296, 139, 25)
$NICEWFM = GUICtrlCreateButton("NICE WFM ", 16, 328, 139, 25)
$MP = GUICtrlCreateButton("Market Prominence", 16, 360, 139, 25)
$ReportManager = GUICtrlCreateButton("Report Manager", 16, 392, 139, 25)
$RXCLAIM = GUICtrlCreateButton("Rx Claim", 16, 424, 139, 25)
$IE = GUICtrlCreateButton("Internet Explorer", 16, 552, 139, 25)
$Dashboard = GUICtrlCreateButton("Dashboard", 16, 488, 139, 25)
$HFHPAPP = GUICtrlCreateButton("HP App page", 16, 520, 139, 25)
$Screen = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\Camera.jpg", 176, 288, 100, 60)
$RxPortal = GUICtrlCreateButton("RxPortal", 16, 456, 139, 25)
$Calc = GUICtrlCreateButton("Calculator", 192, 232, 83, 25)
$Label1 = GUICtrlCreateLabel("Applications", 8, 32, 141, 29)
GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20")
$Label2 = GUICtrlCreateLabel("Tools", 200, 32, 62, 29)
GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20")
$Notepad = GUICtrlCreateButton("Notepad", 192, 72, 83, 25)
$Word = GUICtrlCreateButton("Word", 192, 104, 83, 25)
$Excel = GUICtrlCreateButton("Excel", 192, 136, 83, 25)
$Groupwise = GUICtrlCreateButton("Groupwise", 192, 168, 83, 25)
$HFlogo = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\HF logo.jpg", 288, 10, 180, 60)
$Messenger = GUICtrlCreateButton("Messenger", 192, 200, 83, 25)
$calendar = GUICtrlCreateMonthCal ("Calendar", 192 , 520 , 292 , 172 )
$Edit1 = GUICtrlCreateEdit("", 288, 72, 217, 353)
GUICtrlSetData(-1, "Notes:")
$Page2 = GUICtrlCreateButton("Page 2", 288, 432, 211, 57)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Password = GUICtrlCreatePic ("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\word.jpg" , 24 , 624 , 116 , 76)
$Label3 = GUICtrlCreateLabel("Password Keeper", 24, 605, 136, 22)
GUISetState()


;Run the gui until window is closed
While 1
    $msg = GUIGetMsg()
        Select
    Case $msg = $GUI_EVENT_CLOSE 
        exit
    Case $msg = $Notepad
        Run ("notepad.exe")
    Case $msg = $Calc
        Run ("calc.exe")
    Case $msg = $Amysis
        ShellExecute ("http://hfhp-wcaa.dstcorp.net:8080/amisys-web/Controller?view=jsp/Pportal.jsp")
    Case $msg = $CareManager
        ShellExecute("https://apps-hfhp.healthedge.net/Citrix/XenApp/hfhp/auth/login.aspx")
    Case $msg = $CSA
        ShellExecute("http://hfhp-wccsa.dstcorp.net:8080/hfhp-PROD-csa/portal")
    Case $msg = $HealthX
        ShellExecute("https://secure.healthx.com/publicservice/loginv1/login.aspx?bc=c1503d12-e5a7-43ba-8dc8-4ce5cfc2b5e1&serviceid=8d6ab51b-6c4c-4735-a738-87341c01f849")
    Case $msg = $Kronos
        ShellExecute("http://hfvkron.health-first.org/wfc/logon/logonWFC.html")
    Case $msg = $Google
        ShellExecute ("https://www.google.com/?gws_rd=ssl")
    Case $msg = $NCR
        ShellExecute("http://hfepsprod1.priv.health-first.org/CVMEServer/Login.aspx")
    Case $msg = $NICEPerform
        ShellExecute("http://hfniceim1/NiceApplications/Desktop/WebPage/DeskTopWebForm.aspx")
    Case $msg = $NICEWFM
        ShellExecute("http://101.202.40.3/agent/")
    Case $msg = $MP
        run ("MPC4Cunlock.exe")
    Case $msg = $ReportManager
        ShellExecute("http://hfhpsql12p01.priv.health-first.org/Reports/Pages/Folder.aspx")
    Case $msg = $RXCLAIM
        ShellExecute("https://asp.rxclaim.catamaranrx.com/RxClaim.html")    
    Case $msg = $IE
        ShellExecute("http://intranet.health-first.org/")
    Case $msg = $HFHPAPP
        ShellExecute("http://intranet.health-first.org/departments/health_plans/apps/index.cfm")
    Case $msg = $Word
            $Word = _WordCreate (@ScriptDir & "\Test.doc", 1)
; Check @extended return value to see if attach was successful
If @extended Then
    MsgBox(0, "", "Attached to Existing Window")
Else
    MsgBox(0, "", "Created New Window")
EndIf
    Case $msg = $Excel
            $Excel = _ExcelBookNew()
    Case $msg = $Groupwise
        Run("grpwise.exe")  
    Case $msg = $Messenger
        run("C:\Program Files (x86)\Novell\Messenger\NMCL32.exe")
    Case $msg = $Dashboard
        ShellExecute("https://10.8.3.27:8444/cuic/permalink/PermalinkViewer.htmx?viewId=B194CB921000013A02102C0A0A08031B&linkType=dashboard&uuid=9315d5a3-c745-406a-8ad9-43b27dc55749")
    Case $msg = $Password
        ShellExecute( "S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Files\BLANK Password Keeper.doc")
    Case $msg = $HFlogo
        ShellExecute ("https://www.youtube.com/watch?v=9cQgQIMlwWw")
    Case $msg = $RxPortal
        ShellExecute("https://healthfirsttrain.rxportal.sxc.com/rxclaim/portal/memberLogin")
    ; Create screen shot to save to desktop
    Case $msg = $Screen
        $Screen = _ScreenCapture_SaveImage(@DesktopDir & "\new_screenshot.jpg", $hBmp)
        $hBmp = _ScreenCapture_Capture("")
    case $msg = $page2
    while 1
    $aMsg = GUIGetMsg(1)
        Switch $aMsg[1]
        case $mygui
            Switch $aMsg[0]
            case $GUI_EVENT_CLOSE
                ExitLoop
            case $Page2 
                GUICtrlSetState ($Page2, $GUI_DISABLE)
                gui2()
            EndSwitch
        case $gui2
            switch $aMsg [0]
                case $GUI_EVENT_CLOSE
                GUIDelete($gui2)
                GUICtrlSetState($Page2, $GUI_ENABLE)
            EndSwitch
        EndSwitch
    WEnd    
        
        EndSelect
    WEnd
EndFunc


Func gui2 ()
$gui2 = GUICreate("Customer Service Launcher", 514, 548, 304, 168)
GUISetCursor (2)
GUISetFont(10, 800, 0, "MS Sans Serif")
GUISetBkColor(0xA6CAF0)
$HFlogo = GUICtrlCreatePic("C:\Users\ry207033\Desktop\HF logo.jpg", 288, 8, 212, 60)
$Page1 = GUICtrlCreateButton("Page 1", 8, 488, 123, 41)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Application Issues and Feedback", 8, 8, 270, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlCreateEdit("", 24, 136, 465, 337)
GUICtrlSetBkColor(-1, 0xF4F7FC)
$Submit = GUICtrlCreateButton("Submit", 368, 488, 123, 41)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Please leave feedback including Aplication/Time/Date/and issue ", 24, 104, 458, 20)
GUISetState(@SW_SHOW)

EndFunc
Link to comment
Share on other sites

You have two while loops jammed together, integrate it into one while loop and you should be golden. :)

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Thank you for the response!

I took the second While loop and now the second GUI wont' load when the button is clicked :ermm:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.1
 Author:         Ryan Bailey

 Script Function:
CS Application Launcher

#ce ----------------------------------------------------------------------------

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#include <IE.au3>
#include <Word.au3>
#include <excel.au3>
#include <ScreenCapture.au3>


opt("MustDeclareVar" , 1)

MainGUI()

;Name the Variables
Func MainGUI()
    Global  $gui2 , $hBmp , $SeondaryGUI ,  $Page2 , $hBmp , $Screen , $mygui , $newmsg , $Label3 , $Submit , $Edit , $Amysis , $CareManager , $CSA , $HealthX , $Kronos , $Google , $NCR , $NICEPerform , $NICEWFM , $MP , $ReportManager , $RXCLAIM
    Global  $RxPortal , $ie , $Calc , $Password ,$IE , $Button14 , $HFHPAPP , $Button16 , $Label1 , $Label2 ,$Notepad , $Word , $Excel , $Groupwise, $Messenger , $HFlogo , $Button21 , $Pic1 , $CSapps , $msg

;Create the main GUI

$mygui = GUICreate("Customer Service Omni-Tool", 514, 711, 258, 173)
GUISetCursor (2)
GUISetFont(10, 800, 0, "MS Sans Serif")
GUISetBkColor(0xA6CAF0)


;Assign the Variables
$Amysis = GUICtrlCreateButton("Amysis", 16, 72, 139, 25)
$CareManager = GUICtrlCreateButton("Care Manager", 16, 104, 139, 25)
$CSA = GUICtrlCreateButton("CSA", 16, 136, 139, 25)
$HealthX = GUICtrlCreateButton("Health X", 16, 168, 139, 25)
$Kronos = GUICtrlCreateButton("Kronos", 16, 200, 139, 25)
$Google = GUICtrlCreateButton("Google", 16, 232, 139, 25)
$NCR = GUICtrlCreateButton("NCR", 16, 264, 139, 25)
$NICEPerform = GUICtrlCreateButton("NICE Perform", 16, 296, 139, 25)
$NICEWFM = GUICtrlCreateButton("NICE WFM ", 16, 328, 139, 25)
$MP = GUICtrlCreateButton("Market Prominence", 16, 360, 139, 25)
$ReportManager = GUICtrlCreateButton("Report Manager", 16, 392, 139, 25)
$RXCLAIM = GUICtrlCreateButton("Rx Claim", 16, 424, 139, 25)
$IE = GUICtrlCreateButton("Internet Explorer", 16, 552, 139, 25)
$Dashboard = GUICtrlCreateButton("Dashboard", 16, 488, 139, 25)
$HFHPAPP = GUICtrlCreateButton("HP App page", 16, 520, 139, 25)
$Screen = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\Camera.jpg", 176, 288, 100, 60)
$RxPortal = GUICtrlCreateButton("RxPortal", 16, 456, 139, 25)
$Calc = GUICtrlCreateButton("Calculator", 192, 232, 83, 25)
$Label1 = GUICtrlCreateLabel("Applications", 8, 32, 141, 29)
GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20")
$Label2 = GUICtrlCreateLabel("Tools", 200, 32, 62, 29)
GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20")
$Notepad = GUICtrlCreateButton("Notepad", 192, 72, 83, 25)
$Word = GUICtrlCreateButton("Word", 192, 104, 83, 25)
$Excel = GUICtrlCreateButton("Excel", 192, 136, 83, 25)
$Groupwise = GUICtrlCreateButton("Groupwise", 192, 168, 83, 25)
$HFlogo = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\HF logo.jpg", 288, 10, 180, 60)
$Messenger = GUICtrlCreateButton("Messenger", 192, 200, 83, 25)
$calendar = GUICtrlCreateMonthCal ("Calendar", 192 , 520 , 292 , 172 )
$Edit1 = GUICtrlCreateEdit("", 288, 72, 217, 353)
GUICtrlSetData(-1, "Notes:")
$Page2 = GUICtrlCreateButton("Page 2", 288, 432, 211, 57)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Password = GUICtrlCreatePic ("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\word.jpg" , 24 , 624 , 116 , 76)
$Label3 = GUICtrlCreateLabel("Password Keeper", 24, 605, 136, 22)
GUISetState()


;Run the gui until window is closed
While 1
    $msg = GUIGetMsg()
        Select
    Case $msg = $GUI_EVENT_CLOSE 
        exit
    Case $msg = $Notepad
        Run ("notepad.exe")
    Case $msg = $Calc
        Run ("calc.exe")
    Case $msg = $Amysis
        ShellExecute ("http://hfhp-wcaa.dstcorp.net:8080/amisys-web/Controller?view=jsp/Pportal.jsp")
    Case $msg = $CareManager
        ShellExecute("https://apps-hfhp.healthedge.net/Citrix/XenApp/hfhp/auth/login.aspx")
    Case $msg = $CSA
        ShellExecute("http://hfhp-wccsa.dstcorp.net:8080/hfhp-PROD-csa/portal")
    Case $msg = $HealthX
        ShellExecute("https://secure.healthx.com/publicservice/loginv1/login.aspx?bc=c1503d12-e5a7-43ba-8dc8-4ce5cfc2b5e1&serviceid=8d6ab51b-6c4c-4735-a738-87341c01f849")
    Case $msg = $Kronos
        ShellExecute("http://hfvkron.health-first.org/wfc/logon/logonWFC.html")
    Case $msg = $Google
        ShellExecute ("https://www.google.com/?gws_rd=ssl")
    Case $msg = $NCR
        ShellExecute("http://hfepsprod1.priv.health-first.org/CVMEServer/Login.aspx")
    Case $msg = $NICEPerform
        ShellExecute("http://hfniceim1/NiceApplications/Desktop/WebPage/DeskTopWebForm.aspx")
    Case $msg = $NICEWFM
        ShellExecute("http://101.202.40.3/agent/")
    Case $msg = $MP
        run ("MPC4Cunlock.exe")
    Case $msg = $ReportManager
        ShellExecute("http://hfhpsql12p01.priv.health-first.org/Reports/Pages/Folder.aspx")
    Case $msg = $RXCLAIM
        ShellExecute("https://asp.rxclaim.catamaranrx.com/RxClaim.html")    
    Case $msg = $IE
        ShellExecute("http://intranet.health-first.org/")
    Case $msg = $HFHPAPP
        ShellExecute("http://intranet.health-first.org/departments/health_plans/apps/index.cfm")
    Case $msg = $Word
            $Word = _WordCreate (@ScriptDir & "\Test.doc", 1)
; Check @extended return value to see if attach was successful
If @extended Then
    MsgBox(0, "", "Attached to Existing Window")
Else
    MsgBox(0, "", "Created New Window")
EndIf
    Case $msg = $Excel
            $Excel = _ExcelBookNew()
    Case $msg = $Groupwise
        Run("grpwise.exe")  
    Case $msg = $Messenger
        run("C:\Program Files (x86)\Novell\Messenger\NMCL32.exe")
    Case $msg = $Dashboard
        ShellExecute("https://10.8.3.27:8444/cuic/permalink/PermalinkViewer.htmx?viewId=B194CB921000013A02102C0A0A08031B&linkType=dashboard&uuid=9315d5a3-c745-406a-8ad9-43b27dc55749")
    Case $msg = $Password
        ShellExecute( "S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Files\BLANK Password Keeper.doc")
    Case $msg = $HFlogo
        ShellExecute ("https://www.youtube.com/watch?v=9cQgQIMlwWw")
    Case $msg = $RxPortal
        ShellExecute("https://healthfirsttrain.rxportal.sxc.com/rxclaim/portal/memberLogin")
    ; Create screen shot to save to desktop
    Case $msg = $Screen
        $Screen = _ScreenCapture_SaveImage(@DesktopDir & "\new_screenshot.jpg", $hBmp)
        $hBmp = _ScreenCapture_Capture("")
    case $msg = $page2
        
    $aMsg = GUIGetMsg(1)
        Switch $aMsg[1]
        case $mygui
            Switch $aMsg[0]
            case $GUI_EVENT_CLOSE
                ExitLoop
            case $Page2 
                GUICtrlSetState ($Page2, $GUI_DISABLE)
                gui2()
            EndSwitch
        case $gui2
            switch $aMsg [0]
                case $GUI_EVENT_CLOSE
                GUIDelete($gui2)
                GUICtrlSetState($Page2, $GUI_ENABLE)
            EndSwitch
        EndSwitch
        EndSelect
    WEnd
EndFunc


Func gui2 ()
$gui2 = GUICreate("Customer Service Launcher", 514, 548, 304, 168)
GUISetCursor (2)
GUISetFont(10, 800, 0, "MS Sans Serif")
GUISetBkColor(0xA6CAF0)
$HFlogo = GUICtrlCreatePic("C:\Users\ry207033\Desktop\HF logo.jpg", 288, 8, 212, 60)
$Page1 = GUICtrlCreateButton("Page 1", 8, 488, 123, 41)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Application Issues and Feedback", 8, 8, 270, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlCreateEdit("", 24, 136, 465, 337)
GUICtrlSetBkColor(-1, 0xF4F7FC)
$Submit = GUICtrlCreateButton("Submit", 368, 488, 123, 41)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Please leave feedback including Aplication/Time/Date/and issue ", 24, 104, 458, 20)
GUISetState(@SW_SHOW)

EndFunc
Link to comment
Share on other sites

It's still pretty much the same.

Should be like this (untested):

#cs ----------------------------------------------------------------------------

    AutoIt Version: 3.3.6.1
    Author:         Ryan Bailey

    Script Function:
    CS Application Launcher

#ce ----------------------------------------------------------------------------

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#include <IE.au3>
#include <Word.au3>
#include <excel.au3>
#include <ScreenCapture.au3>


;Opt("MustDeclareVar", 1)

MainGUI()

;Name the Variables
Func MainGUI()
    Global $gui2 = 9999, $hBmp, $SeondaryGUI, $Page2, $hBmp, $Screen, $mygui, $newmsg, $Label3, $Submit, $Edit, $Amysis, $CareManager, $CSA, $HealthX, $Kronos, $Google, $NCR, $NICEPerform, $NICEWFM, $MP, $ReportManager, $RXCLAIM
    Global $RxPortal, $ie, $page1 = 9999, $Calc, $Password, $ie, $Button14, $HFHPAPP, $Button16, $Label1 = 9999, $Label2, $Notepad, $Word, $Excel, $Groupwise, $Messenger, $HFlogo, $Button21, $Pic1, $CSapps, $msg

    ;Create the main GUI

    $mygui = GUICreate("Customer Service Omni-Tool", 514, 711, 258, 173)
    GUISetCursor(2)
    GUISetFont(10, 800, 0, "MS Sans Serif")
    GUISetBkColor(0xA6CAF0)


    ;Assign the Variables
    $Amysis = GUICtrlCreateButton("Amysis", 16, 72, 139, 25)
    $CareManager = GUICtrlCreateButton("Care Manager", 16, 104, 139, 25)
    $CSA = GUICtrlCreateButton("CSA", 16, 136, 139, 25)
    $HealthX = GUICtrlCreateButton("Health X", 16, 168, 139, 25)
    $Kronos = GUICtrlCreateButton("Kronos", 16, 200, 139, 25)
    $Google = GUICtrlCreateButton("Google", 16, 232, 139, 25)
    $NCR = GUICtrlCreateButton("NCR", 16, 264, 139, 25)
    $NICEPerform = GUICtrlCreateButton("NICE Perform", 16, 296, 139, 25)
    $NICEWFM = GUICtrlCreateButton("NICE WFM ", 16, 328, 139, 25)
    $MP = GUICtrlCreateButton("Market Prominence", 16, 360, 139, 25)
    $ReportManager = GUICtrlCreateButton("Report Manager", 16, 392, 139, 25)
    $RXCLAIM = GUICtrlCreateButton("Rx Claim", 16, 424, 139, 25)
    $ie = GUICtrlCreateButton("Internet Explorer", 16, 552, 139, 25)
    $Dashboard = GUICtrlCreateButton("Dashboard", 16, 488, 139, 25)
    $HFHPAPP = GUICtrlCreateButton("HP App page", 16, 520, 139, 25)
    $Screen = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\Camera.jpg", 176, 288, 100, 60)
    $RxPortal = GUICtrlCreateButton("RxPortal", 16, 456, 139, 25)
    $Calc = GUICtrlCreateButton("Calculator", 192, 232, 83, 25)
    $Label1 = GUICtrlCreateLabel("Applications", 8, 32, 141, 29)
    GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20")
    $Label2 = GUICtrlCreateLabel("Tools", 200, 32, 62, 29)
    GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20")
    $Notepad = GUICtrlCreateButton("Notepad", 192, 72, 83, 25)
    $Word = GUICtrlCreateButton("Word", 192, 104, 83, 25)
    $Excel = GUICtrlCreateButton("Excel", 192, 136, 83, 25)
    $Groupwise = GUICtrlCreateButton("Groupwise", 192, 168, 83, 25)
    $HFlogo = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\HF logo.jpg", 288, 10, 180, 60)
    $Messenger = GUICtrlCreateButton("Messenger", 192, 200, 83, 25)
    $calendar = GUICtrlCreateMonthCal("Calendar", 192, 520, 292, 172)
    $Edit1 = GUICtrlCreateEdit("", 288, 72, 217, 353)
    GUICtrlSetData(-1, "Notes:")
    $Page2 = GUICtrlCreateButton("Page 2", 288, 432, 211, 57)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $Password = 9999
    $Password = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\word.jpg", 24, 624, 116, 76)
    $Label3 = GUICtrlCreateLabel("Password Keeper", 24, 605, 136, 22)
    GUISetState()


    ;Run the gui until window is closed
    While 1
        $aMsg = GUIGetMsg(1)
        Switch $aMsg[1]
            Case $mygui
                Switch $aMsg[0]
                    Case $GUI_EVENT_CLOSE
                        ExitLoop
                    Case $Page2
                        GUICtrlSetState($Page2, $GUI_DISABLE)
                        gui2()
                    Case $msg = $Notepad
                        Run("notepad.exe")
                    Case $msg = $Calc
                        Run("calc.exe")
                    Case $msg = $Amysis
                        ShellExecute("http://hfhp-wcaa.dstcorp.net:8080/amisys-web/Controller?view=jsp/Pportal.jsp")
                    Case $msg = $CareManager
                        ShellExecute("https://apps-hfhp.healthedge.net/Citrix/XenApp/hfhp/auth/login.aspx")
                    Case $msg = $CSA
                        ShellExecute("http://hfhp-wccsa.dstcorp.net:8080/hfhp-PROD-csa/portal")
                    Case $msg = $HealthX
                        ShellExecute("https://secure.healthx.com/publicservice/loginv1/login.aspx?bc=c1503d12-e5a7-43ba-8dc8-4ce5cfc2b5e1&serviceid=8d6ab51b-6c4c-4735-a738-87341c01f849")
                    Case $msg = $Kronos
                        ShellExecute("http://hfvkron.health-first.org/wfc/logon/logonWFC.html")
                    Case $msg = $Google
                        ShellExecute("https://www.google.com/?gws_rd=ssl")
                    Case $msg = $NCR
                        ShellExecute("http://hfepsprod1.priv.health-first.org/CVMEServer/Login.aspx")
                    Case $msg = $NICEPerform
                        ShellExecute("http://hfniceim1/NiceApplications/Desktop/WebPage/DeskTopWebForm.aspx")
                    Case $msg = $NICEWFM
                        ShellExecute("http://101.202.40.3/agent/")
                    Case $msg = $MP
                        Run("MPC4Cunlock.exe")
                    Case $msg = $ReportManager
                        ShellExecute("http://hfhpsql12p01.priv.health-first.org/Reports/Pages/Folder.aspx")
                    Case $msg = $RXCLAIM
                        ShellExecute("https://asp.rxclaim.catamaranrx.com/RxClaim.html")
                    Case $msg = $ie
                        ShellExecute("http://intranet.health-first.org/")
                    Case $msg = $HFHPAPP
                        ShellExecute("http://intranet.health-first.org/departments/health_plans/apps/index.cfm")
                    Case $msg = $Word
                        $Word = _WordCreate(@ScriptDir & "\Test.doc", 1)
                        ; Check @extended return value to see if attach was successful
                        If @extended Then
                            MsgBox(0, "", "Attached to Existing Window")
                        Else
                            MsgBox(0, "", "Created New Window")
                        EndIf
                    Case $msg = $Excel
                        $Excel = _ExcelBookNew()
                    Case $msg = $Groupwise
                        Run("grpwise.exe")
                    Case $msg = $Messenger
                        Run("C:\Program Files (x86)\Novell\Messenger\NMCL32.exe")
                    Case $msg = $Dashboard
                        ShellExecute("https://10.8.3.27:8444/cuic/permalink/PermalinkViewer.htmx?viewId=B194CB921000013A02102C0A0A08031B&linkType=dashboard&uuid=9315d5a3-c745-406a-8ad9-43b27dc55749")
                        ;Case $msg = $Password
                        ;   ShellExecute("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Files\BLANK Password Keeper.doc")
                        ;Case $msg = $HFlogo
                        ;   ShellExecute("https://www.youtube.com/watch?v=9cQgQIMlwWw")
                    Case $msg = $RxPortal
                        ShellExecute("https://healthfirsttrain.rxportal.sxc.com/rxclaim/portal/memberLogin")
                        ; Create screen shot to save to desktop
                    Case $msg = $Screen
                        $Screen = _ScreenCapture_SaveImage(@DesktopDir & "\new_screenshot.jpg", $hBmp)
                        $hBmp = _ScreenCapture_Capture("")
                    Case $msg = $Page2
                EndSwitch
            Case $gui2
                Switch $aMsg[0]
                    Case $GUI_EVENT_CLOSE
                        GUIDelete($gui2)
                        GUICtrlSetState($Page2, $GUI_ENABLE)
                EndSwitch
        EndSwitch

    WEnd
EndFunc   ;==>MainGUI


Func gui2()
    $gui2 = GUICreate("Customer Service Launcher", 514, 548, 304, 168)
    GUISetCursor(2)
    GUISetFont(10, 800, 0, "MS Sans Serif")
    GUISetBkColor(0xA6CAF0)
    $HFlogo = GUICtrlCreatePic("C:\Users\ry207033\Desktop\HF logo.jpg", 288, 8, 212, 60)
    $page1 = GUICtrlCreateButton("Page 1", 8, 488, 123, 41)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $Label1 = GUICtrlCreateLabel("Application Issues and Feedback", 8, 8, 270, 24)
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
    GUICtrlCreateEdit("", 24, 136, 465, 337)
    GUICtrlSetBkColor(-1, 0xF4F7FC)
    $Submit = GUICtrlCreateButton("Submit", 368, 488, 123, 41)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $Label2 = GUICtrlCreateLabel("Please leave feedback including Aplication/Time/Date/and issue ", 24, 104, 458, 20)
    GUISetState(@SW_SHOW)

EndFunc   ;==>gui2

It will run the pics I know that, right away because of how you have the event.

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

  • Developers
  • Solution

I haven't tested but should the second gui selection look something like this?:

Case $msg = $Page2
                GUICtrlSetState($Page2, $GUI_Disable)
                Local $hGui2=gui2()
                $aMsg = GUIGetMsg($hGui2)
                Switch $aMsg
                    Case $GUI_EVENT_CLOSE
                        ExitLoop
                    Case $GUI_EVENT_CLOSE
                        ExitLoop
                EndSwitch
                GUIDelete($gui2)
                GUICtrlSetState($Page2, $GUI_ENABLE)

Are you running au3check by using the full installer of SciTE4AutoIt3? I get some errors like:

script.au3"(22,24) : error: Opt() called with illegal argument 1: "MustDeclareVar".
Opt("MustDeclareVar", 1)
~~~~~~~~~~~~~~~~~~~~~~~^

which should be: "MustDeclareVars"

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Je maintiendrai I changed the scripting to this but now the second GUI won't launch pops up real quick then goes away. This is what I have so far

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.1
 Author:         Ryan Bailey

 Script Function:
CS Application Launcher

#ce ----------------------------------------------------------------------------

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#include <IE.au3>
#include <Word.au3>
#include <excel.au3>
#include <ScreenCapture.au3>


opt("MustDeclareVar" , 1)

MainGUI()

;Name the Variables
Func MainGUI()
    Global  $hGUI2 , $gui2 , $hBmp , $SeondaryGUI ,  $Page2 , $hBmp , $Screen , $mygui , $newmsg , $Label3 , $Submit , $Edit , $Amysis , $CareManager , $CSA , $HealthX , $Kronos , $Google , $NCR , $NICEPerform , $NICEWFM , $MP , $ReportManager , $RXCLAIM
    Global  $RxPortal , $ie , $Calc , $Password ,$IE , $Button14 , $HFHPAPP , $Button16 , $Label1 , $Label2 ,$Notepad , $Word , $Excel , $Groupwise, $Messenger , $HFlogo , $Button21 , $Pic1 , $CSapps , $msg

;Create the main GUI

$mygui = GUICreate("Customer Service Omni-Tool", 514, 711, 258, 173)
GUISetCursor (2)
GUISetFont(10, 800, 0, "MS Sans Serif")
GUISetBkColor(0xA6CAF0)


;Assign the Variables
$Amysis = GUICtrlCreateButton("Amysis", 16, 72, 139, 25)
$CareManager = GUICtrlCreateButton("Care Manager", 16, 104, 139, 25)
$CSA = GUICtrlCreateButton("CSA", 16, 136, 139, 25)
$HealthX = GUICtrlCreateButton("Health X", 16, 168, 139, 25)
$Kronos = GUICtrlCreateButton("Kronos", 16, 200, 139, 25)
$Google = GUICtrlCreateButton("Google", 16, 232, 139, 25)
$NCR = GUICtrlCreateButton("NCR", 16, 264, 139, 25)
$NICEPerform = GUICtrlCreateButton("NICE Perform", 16, 296, 139, 25)
$NICEWFM = GUICtrlCreateButton("NICE WFM ", 16, 328, 139, 25)
$MP = GUICtrlCreateButton("Market Prominence", 16, 360, 139, 25)
$ReportManager = GUICtrlCreateButton("Report Manager", 16, 392, 139, 25)
$RXCLAIM = GUICtrlCreateButton("Rx Claim", 16, 424, 139, 25)
$IE = GUICtrlCreateButton("Internet Explorer", 16, 552, 139, 25)
$Dashboard = GUICtrlCreateButton("Dashboard", 16, 488, 139, 25)
$HFHPAPP = GUICtrlCreateButton("HP App page", 16, 520, 139, 25)
$Screen = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\Camera.jpg", 176, 288, 100, 60)
$RxPortal = GUICtrlCreateButton("RxPortal", 16, 456, 139, 25)
$Calc = GUICtrlCreateButton("Calculator", 192, 232, 83, 25)
$Label1 = GUICtrlCreateLabel("Applications", 8, 32, 141, 29)
GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20")
$Label2 = GUICtrlCreateLabel("Tools", 200, 32, 62, 29)
GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20")
$Notepad = GUICtrlCreateButton("Notepad", 192, 72, 83, 25)
$Word = GUICtrlCreateButton("Word", 192, 104, 83, 25)
$Excel = GUICtrlCreateButton("Excel", 192, 136, 83, 25)
$Groupwise = GUICtrlCreateButton("Groupwise", 192, 168, 83, 25)
$HFlogo = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\HF logo.jpg", 288, 10, 180, 60)
$Messenger = GUICtrlCreateButton("Messenger", 192, 200, 83, 25)
$calendar = GUICtrlCreateMonthCal ("Calendar", 192 , 520 , 292 , 172 )
$Edit1 = GUICtrlCreateEdit("", 288, 72, 217, 353)
GUICtrlSetData(-1, "Notes:")
$Page2 = GUICtrlCreateButton("Page 2", 288, 432, 211, 57)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Password = GUICtrlCreatePic ("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\word.jpg" , 24 , 624 , 116 , 76)
$Label3 = GUICtrlCreateLabel("Password Keeper", 24, 605, 136, 22)
GUISetState()


;Run the gui until window is closed
While 1
    $msg = GUIGetMsg()
        Select
    Case $msg = $GUI_EVENT_CLOSE 
        exit
    Case $msg = $Notepad
        Run ("notepad.exe")
    Case $msg = $Calc
        Run ("calc.exe")
    Case $msg = $Amysis
        ShellExecute ("http://hfhp-wcaa.dstcorp.net:8080/amisys-web/Controller?view=jsp/Pportal.jsp")
    Case $msg = $CareManager
        ShellExecute("https://apps-hfhp.healthedge.net/Citrix/XenApp/hfhp/auth/login.aspx")
    Case $msg = $CSA
        ShellExecute("http://hfhp-wccsa.dstcorp.net:8080/hfhp-PROD-csa/portal")
    Case $msg = $HealthX
        ShellExecute("https://secure.healthx.com/publicservice/loginv1/login.aspx?bc=c1503d12-e5a7-43ba-8dc8-4ce5cfc2b5e1&serviceid=8d6ab51b-6c4c-4735-a738-87341c01f849")
    Case $msg = $Kronos
        ShellExecute("http://hfvkron.health-first.org/wfc/logon/logonWFC.html")
    Case $msg = $Google
        ShellExecute ("https://www.google.com/?gws_rd=ssl")
    Case $msg = $NCR
        ShellExecute("http://hfepsprod1.priv.health-first.org/CVMEServer/Login.aspx")
    Case $msg = $NICEPerform
        ShellExecute("http://hfniceim1/NiceApplications/Desktop/WebPage/DeskTopWebForm.aspx")
    Case $msg = $NICEWFM
        ShellExecute("http://101.202.40.3/agent/")
    Case $msg = $MP
        run ("MPC4Cunlock.exe")
    Case $msg = $ReportManager
        ShellExecute("http://hfhpsql12p01.priv.health-first.org/Reports/Pages/Folder.aspx")
    Case $msg = $RXCLAIM
        ShellExecute("https://asp.rxclaim.catamaranrx.com/RxClaim.html")    
    Case $msg = $IE
        ShellExecute("http://intranet.health-first.org/")
    Case $msg = $HFHPAPP
        ShellExecute("http://intranet.health-first.org/departments/health_plans/apps/index.cfm")
    Case $msg = $Word
            $Word = _WordCreate (@ScriptDir & "\Test.doc", 1)
; Check @extended return value to see if attach was successful
If @extended Then
    MsgBox(0, "", "Attached to Existing Window")
Else
    MsgBox(0, "", "Created New Window")
EndIf
    Case $msg = $Excel
            $Excel = _ExcelBookNew()
    Case $msg = $Groupwise
        Run("grpwise.exe")  
    Case $msg = $Messenger
        run("C:\Program Files (x86)\Novell\Messenger\NMCL32.exe")
    Case $msg = $Dashboard
        ShellExecute("https://10.8.3.27:8444/cuic/permalink/PermalinkViewer.htmx?viewId=B194CB921000013A02102C0A0A08031B&linkType=dashboard&uuid=9315d5a3-c745-406a-8ad9-43b27dc55749")
    Case $msg = $Password
        ShellExecute( "S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Files\BLANK Password Keeper.doc")
    Case $msg = $RxPortal
        ShellExecute("https://healthfirsttrain.rxportal.sxc.com/rxclaim/portal/memberLogin")
    ; Create screen shot to save to desktop
    Case $msg = $Screen
        $hBmp = _ScreenCapture_Capture("")
        $Screen = _ScreenCapture_SaveImage(@DesktopDir & "\new_screenshot.jpg", $hBmp)
        ExitLoop
    case $msg = $page2
        GUICtrlSetState ($mygui, $GUI_DISABLE)
        local $hGUI2 = gui2()
        $aMsg = GUIGetMsg($hGUI2)
        Switch $aMsg
        case $GUI_EVENT_CLOSE
            ExitLoop
        case $GUI_EVENT_CLOSE
            ExitLoop
            EndSwitch
        GUIDelete($gui2)
        GUICtrlSetState($Page2, $GUI_ENABLE)
        EndSelect
    WEnd
EndFunc


Func gui2()
$gui2 = GUICreate("Customer Service Launcher", 514, 548, 304, 168)
GUISetCursor (2)
GUISetFont(10, 800, 0, "MS Sans Serif")
GUISetBkColor(0xA6CAF0)
$HFlogo = GUICtrlCreatePic("C:\Users\ry207033\Desktop\HF logo.jpg", 288, 8, 212, 60)
$Page1 = GUICtrlCreateButton("Page 1", 8, 488, 123, 41)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Application Issues and Feedback", 8, 8, 270, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlCreateEdit("", 24, 136, 465, 337)
GUICtrlSetBkColor(-1, 0xF4F7FC)
$Submit = GUICtrlCreateButton("Submit", 368, 488, 123, 41)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Please leave feedback including Aplication/Time/Date/and issue ", 24, 104, 458, 20)
GUISetState(@SW_SHOW)

EndFunc
Link to comment
Share on other sites

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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...