kw_rock Posted October 28, 2009 Share Posted October 28, 2009 (edited) My GUI starts like this $path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\dfdf", "Path") $win = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\dfdf", "Window") $dfdfRelog = GUICreate("dfdf", 301, 402, 480, 198) $PathLoc = GUICtrlCreateInput($path, 8, 208, 193, 21) $WindowName = GUICtrlCreateInput($win, 8, 280, 193, 21) MY GOAL is to create buttons at the bottom. One will say "Start" and one will say "Exit" Exit will obviously close the program. When they click "Start", I want to save the values that are currently typed into the input boxes, AND THEN run the main function. For some reason, though..... I cannot figure it out. Does anyone want to help? Thanks Edited October 28, 2009 by kw_rock Link to comment Share on other sites More sharing options...
Authenticity Posted October 28, 2009 Share Posted October 28, 2009 (edited) You need a message loop, or something similar to get notified when the button was clicked: #include <GUIConstantsEx.au3> ; ... $BtnStart = GUICtrlCreateButton("&Start", 50, 70, 70, 24) ; for example $BtnClose = GUICtrlCreateButton("&Exit", 50, 110, 70, 24) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $BtnClose GUIDelete() Exit Case $BtnStart Local $sPath = GUICtrlRead($PathLoc) Local $sWindowName = GUICtrlRead($WindowName) ; Work with data using FileOpen(), FileWrite() or some other destination stream. ; Run main function. EndSwitch WEnd Edited October 28, 2009 by Authenticity Link to comment Share on other sites More sharing options...
Zedna Posted October 28, 2009 Share Posted October 28, 2009 (edited) Also look at Koda form designer for easy creating Autoit's GUIs and generating code for it.http://www.autoitscript.com/forum/index.php?showtopic=32299 Edited October 28, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
kw_rock Posted October 28, 2009 Author Share Posted October 28, 2009 (edited) Awesome, it's saving values and everything! When I hit Exit, it closes. When I hit Start, it saves the new values but DOESN'T run the main function, and doesn't close the dialog box. When i hit Exit AFTER hitting start, it doesn't do anything. Edited October 28, 2009 by kw_rock Link to comment Share on other sites More sharing options...
martin Posted October 28, 2009 Share Posted October 28, 2009 Awesome, it's saving values and everything!When I hit Exit, it closes.When I hit Start, it saves the new values but DOESN'T run the main function, and doesn't close the dialog box.When i hit Exit AFTER hitting start, it doesn't do anything.That's funny; it looks to me like it should work fine. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
kw_rock Posted October 29, 2009 Author Share Posted October 29, 2009 (edited) NEVERMIND! Works like a charm! Thanks guys Edited October 29, 2009 by kw_rock 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