HackerZer0 Posted December 9, 2006 Share Posted December 9, 2006 how could i make this script run somthing when somthing was typed into the input box? #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.6 Prototype #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 85,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Input_1 = GuiCtrlCreateInput("", 30, 30, 220, 30) $Button_2 = GuiCtrlCreateButton("Send", 280, 30, 90, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- for example... i want it to run notepad, but only if i type "notepad" if i type anything else i want to have a msgbox pop up... im really new to the gui part of autoit plz help me Earn money on CASHCRATE by sitting around doing nothing.. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 9, 2006 Developers Share Posted December 9, 2006 #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.6 Prototype #include <GuiConstants.au3> GUICreate("MyGUI", 392, 85, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Input_1 = GUICtrlCreateInput("", 30, 30, 220, 30) $Button_2 = GUICtrlCreateButton("Send", 280, 30, 90, 30) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_2 If GUICtrlRead($Input_1) = "Notepad" Then MsgBox(0,"notepad", "typed") Else MsgBox(0,"Something else", "typed") EndIf Case Else EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- 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 More sharing options...
HackerZer0 Posted December 11, 2006 Author Share Posted December 11, 2006 ok thx alot : ) Earn money on CASHCRATE by sitting around doing nothing.. Link to comment Share on other sites More sharing options...
HackerZer0 Posted December 11, 2006 Author Share Posted December 11, 2006 ok one more question... how would i make the script read the input from the box, and execute it as if it were a line in an autoit script? example: i type Run("notepad.exe") and click "Send" i want it to run notepad, -OR- if i type WinSetTrans("Untitled - Notepad", "", 178) I want it to change the transparency... THX : ) Earn money on CASHCRATE by sitting around doing nothing.. Link to comment Share on other sites More sharing options...
Rugbee Posted December 11, 2006 Share Posted December 11, 2006 Something like this might help: CODE;$UserInputBox is the input box you created $RunInput = GUICtrlRead($UserInputBox,1) If $RunInput = "" Then MsgBox(160,"Input Required","Please enter path and name of program you wish to run") Else $PathVerify = FileExists($RunInput) IF $PathVerify = 1 Then Run($RunInput) Else MsgBox(16,"Error","Invalid File / Path does not exist") EndIf EndIf 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