Dead_Man Posted August 26, 2006 Share Posted August 26, 2006 like if i made a gui with just one button on it, and when it clicked it executed Run("cmd.exe") is that possable? Link to comment Share on other sites More sharing options...
amanda089 Posted August 26, 2006 Share Posted August 26, 2006 #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 117, 37, 192, 125) $Button1 = GUICtrlCreateButton("Notepad", 0, 0, 116, 36) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $Button1 Run("notepad.exe") Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
Dead_Man Posted August 26, 2006 Author Share Posted August 26, 2006 (edited) awsome, thanks, just getting started with the GUI section of auto it Edited August 26, 2006 by Dead_Man Link to comment Share on other sites More sharing options...
amanda089 Posted August 26, 2006 Share Posted August 26, 2006 awsome, thanks, just getting started with the GUI section of auto itI suggest downloading SciTE/Autoit and use Koda or GuiBuilder, it really simplifies learning about GUI stuff... as well as F1 jumping to the function/macro definition in the included helpfile.SciTE/Autoit Link to comment Share on other sites More sharing options...
Dead_Man Posted August 26, 2006 Author Share Posted August 26, 2006 ive been using SciTE for a long ass time, just new to GUI and Koda Link to comment Share on other sites More sharing options...
Dead_Man Posted August 26, 2006 Author Share Posted August 26, 2006 can anyone tell me how to generate a code like that in Koda?? i can only make a button that does nothing Link to comment Share on other sites More sharing options...
amanda089 Posted August 26, 2006 Share Posted August 26, 2006 can anyone tell me how to generate a code like that in Koda?? i can only make a button that does nothingKoda: => Tools => Generate Code (F9) => Insert into SciTEExit Koda Link to comment Share on other sites More sharing options...
Dead_Man Posted August 26, 2006 Author Share Posted August 26, 2006 (edited) when i said "like that" i ment adding a code to the button that had the script to open a program Edited August 26, 2006 by Dead_Man Link to comment Share on other sites More sharing options...
amanda089 Posted August 26, 2006 Share Posted August 26, 2006 when i said "like that" i ment adding a code to the button that had the script to open a program You have to write the code such as: Case $msg = $Button1 Run("notepad.exe") yourself. Link to comment Share on other sites More sharing options...
gring0 Posted August 26, 2006 Share Posted August 26, 2006 (edited) you can use events too, like in vb: #include <GUIConstants.au3> Opt("GUIOnEventMode",1) ;this is the opt to use events $frmTest = GUICreate("My Form", 415, 307, 292, 192) $button = GUICtrlCreateButton("Run Notepad", 145, 120, 106, 31, 0) GUICtrlSetOnEvent($button, "buttonclick") ;this set a event named "buttonclick" for object $button ;you can use "GuiCtrlSetOnEvent(-1, "buttonclick")" too GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func buttonclick() run("notepad.exe") EndFunc Edited August 26, 2006 by gring0 Never judge my awesome brazilian-english language :D:D<-- lol ;P 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