Sign in to follow this  
Followers 0
mike1305

I am so close I can smell it!

3 posts in this topic

#1 ·  Posted (edited)

I have been working on this all morning, and unfortunately I have reached the limit of interpreting the built in user guide. I don't understand how to use the GUICtrlRead function in order to make my drop-down box selection register with the OK button i am creating. Excuse me if this is an easy one to solve; I haven't used this program in almost 12 months! :"> The code is kind of long but bear with me because I want to give you all that is needed in order to get me across the finish line here.

#include <GUIConstants.au3>

GUICreate ( "Programs", 225, 75)

GUICtrlCreateCombo ( "Select Program", 10, 10)

GUICtrlSetData ( -1, "Adobe Standard 6.0|Remove Project 98|Prolog Manager 7.2|Prolog Manager 7.2 SP2|Citrix 7.1|Remote Agent Install|Screwdrivers|Timberline Accounting 9.1|Estimating 7.1.3", "Select Program")
$data=GUICtrlRead ("GUICtrlCreateCombo")
Opt("GUICoordMode",2)
$okbutton=GUICtrlCreateButton ("OK",  10, 30, 50)
$cancelbutton=GUICtrlCreateButton ( "Cancel",  0, -1)

GUISetState ()

$msg = GUIGetMsg()

While 1
     $msg = GUIGetMsg()

     Select
       Case $msg= $GUI_EVENT_CLOSE
         ExitLoop

       Case $msg = $okbutton
       
         If $data="Select Program" then 
           msgbox(4096, "Error", "Please select a program to (un)install.")
         ElseIf $data="Adobe Standard 6.0" then 
           run("\\rminas\Software\Adobe\Acrobat 6 standard\Adobe Acrobat 6.0 Standard\setup.exe")
         ElseIf $data="Remove Project 98" then 
           run("\\rminas\Software\Adobe\Acrobat 6 standard\Adobe Acrobat 6.0 Standard\SETUP.EXE")
         ElseIf $data="Prolog Manager 7.2" then
           run("\\rminas\Software\Meridian\Prolog 7.20\PM720\setup.exe")
         ElseIf $data="Prolog Manager 7.2 SP2" then 
           run ("\\rminas\Software\Meridian\Prolog 7.20\PM720SP2\PM72SP2.msp")
         ElseIf $data="Citrix 7.1" then 
           run ("\\rminas\Software\Citrix\Citrix ICA Client\Citrix ICA Client 7.100\ica32.exe")
         ElseIf $data="Remote Agent Install" then
           run("\\rminas\Software\Trend Micro\RMI-OfficeScan-StandAlone\RA-Internet.exe")
         ElseIf $data="Screwdrivers" then 
           run("\\rminas\Software\Screwdrivers\3.5.6.5\ScrewDrivers Client v3.56 (search).exe")
         ElseIf $data="Timberline Accounting 9.1" then 
           run ("T:\Timberline\WININST\install.exe")
         ElseIf $data="Estimating 7.1.3" then 
           run ("\\rminas\Software\Timberline Applications\Estimating\launch.exe")
         EndIf
       
       Case $msg = $cancelbutton
         ExitLoop
     EndSelect

Wend

Before I had the $data variable being the GUICtrlSetData but realized that was wrong. now no matter what I select in the drop down box it responds as if I never made a selection (and left it on "Select a Program"). If it would help at all, I would reccomend copying the code and making the script and running it to see what I am trying to get at....

Any help would be vastly appriciated!

-mike

Edited by mike1305

Amp Energy Drink: the official sponsor of me scripting at 2AM.

Share this post


Link to post
Share on other sites



#include <GUIConstants.au3>

GUICreate("Programs", 225, 75)

$combo = GUICtrlCreateCombo("Select Program", 10, 10)

GUICtrlSetData(-1, "Adobe Standard 6.0|Remove Project 98|Prolog Manager 7.2|Prolog Manager 7.2 SP2|Citrix 7.1|Remote Agent Install|Screwdrivers|Timberline Accounting 9.1|Estimating 7.1.3", "Select Program")
Opt("GUICoordMode", 2)
$okbutton = GUICtrlCreateButton("OK", 10, 30, 50)
$cancelbutton = GUICtrlCreateButton("Cancel", 0, -1)

GUISetState()

$msg = GUIGetMsg()

While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
            
        Case $msg = $okbutton
            $data = GUICtrlRead($combo)
            
            If $data = "Select Program" Then
                MsgBox(4096, "Error", "Please select a program to (un)install.")
            ElseIf $data = "Adobe Standard 6.0" Then
                Run("\\rminas\Software\Adobe\Acrobat 6 standard\Adobe Acrobat 6.0 Standard\setup.exe")
            ElseIf $data = "Remove Project 98" Then
                Run("\\rminas\Software\Adobe\Acrobat 6 standard\Adobe Acrobat 6.0 Standard\SETUP.EXE")
            ElseIf $data = "Prolog Manager 7.2" Then
                Run("\\rminas\Software\Meridian\Prolog 7.20\PM720\setup.exe")
            ElseIf $data = "Prolog Manager 7.2 SP2" Then
                Run("\\rminas\Software\Meridian\Prolog 7.20\PM720SP2\PM72SP2.msp")
            ElseIf $data = "Citrix 7.1" Then
                Run("\\rminas\Software\Citrix\Citrix ICA Client\Citrix ICA Client 7.100\ica32.exe")
            ElseIf $data = "Remote Agent Install" Then
                Run("\\rminas\Software\Trend Micro\RMI-OfficeScan-StandAlone\RA-Internet.exe")
            ElseIf $data = "Screwdrivers" Then
                Run("\\rminas\Software\Screwdrivers\3.5.6.5\ScrewDrivers Client v3.56 (search).exe")
            ElseIf $data = "Timberline Accounting 9.1" Then
                Run("T:\Timberline\WININST\install.exe")
            ElseIf $data = "Estimating 7.1.3" Then
                Run("\\rminas\Software\Timberline Applications\Estimating\launch.exe")
            EndIf
            
        Case $msg = $cancelbutton
            ExitLoop
    EndSelect
    
WEnd


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thanks for the quick response. Such a simple fix, but I never would have figured it out... :D


Amp Energy Drink: the official sponsor of me scripting at 2AM.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

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

Create an account

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


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0