Jump to content

Help running an exe with parameters and redirection


Recommended Posts

I'm Using multiple combo boxes but can't collect data from them all at once.

I have an app that has a simple button based menu as the frontend. I realized that before I display that window I needed to ask the user for some data first.

My first question is how do I display the data collection window first and when the data is collected have the data collection window switch to the menu window.

I have already built both windows when I ran into a situation on the data collection window. This window have several (6 or 7) combo boxes where the user selects numeric values in each combo box. I realized I don't know how to get the user selected values into the variables. Would I use multiple GULctrlRead's or assign each value to a seperate variable and if so what triggers the data assignment.

Code:

#include "C:\Program Files\AutoIt3\Include\GuiConstants.au3"

#include "C:\Program Files\AutoIt3\Include\Constants.au3"

; Hides tray icon

#NoTrayIcon

; Change to OnEvent mode

Opt("GUIOnEventMode", 1)

; variable to hold tape 1's numbers

Global $stp1_adpt_no = "0"

Global $stp1_scsi_no = "0"

Global $stp1_lun_no = "0"

; GUI Creation

GuiCreate("Standalone data collection", 150, 150)

; Runs the GUIExit() function if the GUI is closed

GUISetOnEvent($GUI_EVENT_CLOSE, 'GUIExit')

GUICtrlCreateLabel("Tape 1:", 25, 20, 75, 15)

GUICtrlSetColor(-1,0x000000) ; Makes instructions Red

GUICtrlCreateLabel("Adapter:", 25, 40, 40, 15)

GUICtrlSetColor(-1,0x000000) ; Makes instructions Red

GUICtrlCreateCombo(" ",65, 40, 40, 10)

$stp1_adpt_no = GuiCtrlSetData(-1,"1|2|3|4|5|6|7|8|9|10|11|12|13|14|15")

GUICtrlCreateLabel("SCSI:", 25, 60, 40, 15)

GUICtrlSetColor(-1,0x000000) ; Makes instructions Red

GUICtrlCreateCombo(" ",65, 60, 40, 10)

$stp1_scsi_no = GuiCtrlSetData(-1,"1|2|3|4|5|6|7|8|9|10|11|12|13|14|15")

GUICtrlCreateLabel("LUN:", 25, 80, 40, 15)

GUICtrlSetColor(-1,0x000000) ; Makes instructions Red

GUICtrlCreateCombo(" ",65, 80, 40, 10)

$stp1_lun_no = GuiCtrlSetData(-1,"1|2|3|4|5|6|7|8|9|10|11|12|13|14|15")

; Button Creation

$button = GuiCtrlCreateButton("Go",60,115,50,20)

MsgBox(0,"","The adapter number you entered is " & $stp1_adpt_no & ".")

; Shows the GUI after the function completes

GUISetState(@SW_SHOW)

; Idles the script in an infinite loop - this MUST be included when using OnEvent mode

While 1

Sleep(500)

WEnd

; This function makes the script exit when the GUI is closed

Func GUIExit()

Exit

EndFunc

Thank you for any assistance,

Link to comment
Share on other sites

Your title is definitely misleading, it makes it seem like you are trying to run a command line exe with output redirection. You can change the title by editing the first post.

Edited by weaponx
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...