markdui Posted September 11, 2007 Share Posted September 11, 2007 Hi may i know how can i do the below in AutoIT GUI Create a Button upon mouse click it will run a batch file. Create a Inputbox (textbox). The batch file will call the textinout and excute then and sent the output to a screen below it. Link to comment Share on other sites More sharing options...
BrettF Posted September 12, 2007 Share Posted September 12, 2007 Hi may i know how can i do the below in AutoIT GUICreate a Button upon mouse click it will run a batch file.Create a Inputbox (textbox). The batch file will call the textinout and excute then and sent the output to a screen below it.Could you please provide us with some GUI code?? And what you have tried?Also, look at Run in the helpfile. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
markdui Posted September 12, 2007 Author Share Posted September 12, 2007 I have try creating some button and inputbox. Didnt know how to place the rest of the code. Anyway i will try reading the run in help. Thanks Link to comment Share on other sites More sharing options...
BrettF Posted September 12, 2007 Share Posted September 12, 2007 I have try creating some button and inputbox. Didnt know how to place the rest of the code. Anyway i will try reading the run in help. ThanksWell here's how I do it. ;;All the needed includes... #include <GuiConstants.au3> ;Any Varibles are declared. Dim $var = "I am a varible. W00000tttttt!" ;GUI is created GUICreate($var) ;And GUI Opt modes can be declared here, or above. Opt("GUICoordMode", 2); Alters the positioning of controls. ;Create any controls on the GUI $Button_1 = GUICtrlCreateButton("Run Notepad", 10, 30, 100) $Button_2 = GUICtrlCreateButton("Button Test", 0, -1) ;Show the GUI GUISetState(@SW_SHOW) ;Run The GUI until the dialouge is closed While 1 ;Poll the GUI for any changes- Button Presses, changes in text... $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE; So if the big red X on the GUI is pressed, exit ExitLoop Case $msg = $Button_1; if $button_1 is pressed Run('Notepad.exe') ; Will run notepad Case $msg = $Button_2; if $button_2 is pressed MsgBox(0, 'Testing', 'Button 2 was pressed') ; Shows a message box that apears when the button was pressed. EndSelect WEnd That should get you on your merry way... =) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now