Jump to content
Sign in to follow this  

Application Log on

Recommended Posts

I am very new to auto it. I have tried finding what I need, but I have had no luck. I am trying to write a script to run a program, select a choice from a drop down menu, enter in a user name, and enter in a password.

As I said I am a complete noob. If anyone can even point me in the right direction i.e. which help files to read i would be appreciative.

Share this post

Link to post
Share on other sites

You mean something like this:

#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 371, 71)
$Label1 = GUICtrlCreateLabel("Select an application:", 8, 42, 106, 17)
$hCombo = GUICtrlCreateCombo("", 120, 40, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Label2 = GUICtrlCreateLabel("User:", 8, 10, 29, 17)
$Input_userid = GUICtrlCreateInput("", 40, 8, 121, 21)
$Label3 = GUICtrlCreateLabel("Password", 176, 10, 50, 17)
$Input_pwd = GUICtrlCreateInput("", 232, 8, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$Button_run = GUICtrlCreateButton("Run", 304, 38, 51, 25)

_GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.exe")
_GUICtrlComboBox_InsertString($hCombo, "Select an exe from the list", 0)
_GUICtrlComboBox_SetCurSel($hCombo, 0)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $Button_run
            If GUICtrlRead($Input_userid) = "" Or GUICtrlRead($Input_pwd) = "" Then
                MsgBox(16, "Error", "You must enter an user id and password to proceed!")
                If  _GUICtrlComboBox_GetCurSel($hCombo) > 0 Then
                    ShellExecute(@WindowsDir & "\" & _GUICtrlComboBox_GetEditText($hCombo))
                    MsgBox(64, "Information", "Please select an exe from the combo box!")



Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...