jtouma Posted February 1, 2010 Share Posted February 1, 2010 I have created a form with multiple buttons that point to an image, This has worked very well for the time I have been using this. I had this idea on adding a field to each button to declare how many clients are been image. My default right now is 1 client on auto mode. I need to change the last number on Button1Click from 1 to 2 Run("GhostSrv.exe D:\FTPCACHE\FILES\Images\DELL\LAPTOP\D630\D630V8STDDEC09.GHO clone -n1")to Run("GhostSrv.exe D:\FTPCACHE\FILES\Images\DELL\LAPTOP\D630\D630V8STDDEC09.GHO clone -n2") So far my trials have ended in errors and now I am asking for help. I created this small example to show what I am trying to accomplish were Input1 box is I like to change the number in to Button1 Thanks in advance for any help you might suggest. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=d:\documents\ghostexample.kxf $Form1_1 = GUICreate("Form1", 555, 190, 217, 200) $Button1 = GUICtrlCreateButton("Image 1", 32, 56, 113, 33, 0) GUICtrlSetOnEvent($Button1, "Button1Click") $input1 = GUICtrlCreateInput("input1", 168, 64, 57, 21) GUICtrlSetOnEvent($input1, "Input1Change") $Button2 = GUICtrlCreateButton("Exit", 392, 144, 75, 25, 0) GUICtrlSetOnEvent($Button2, "Button2Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func Button1Click() Run("GhostSrv.exe D:\FTPCACHE\FILES\Images\DELL\LAPTOP\D630\D630V8STDDEC09.GHO clone -n1") EndFunc Func Button2Click() Exit EndFunc Func Input1Change() EndFunc Link to comment Share on other sites More sharing options...
jtouma Posted February 1, 2010 Author Share Posted February 1, 2010 (edited) You want the number in the input box to go on the end of this line and it should replace the 1. So if there was a 5 in the input box, the line would look like this. Run("GhostSrv.exe D:\FTPCACHE\FILES\Images\DELL\LAPTOP\D630\D630V8STDDEC09.GHO clone -n5") Is that right? EDIT: After looking up the command line options for GhostSrv.exe, I'm almost certain that this is what you are looking for. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=d:\documents\ghostexample.kxf $Form1_1 = GUICreate("Form1", 555, 190, 217, 200) $Button1 = GUICtrlCreateButton("Image 1", 32, 56, 113, 33, 0) GUICtrlSetOnEvent($Button1, "Button1Click") $input1 = GUICtrlCreateInput("input1", 168, 64, 57, 21, BitOR($ES_LEFT, $ES_AUTOHSCROLL, $ES_NUMBER)) GUICtrlSetOnEvent($input1, "Input1Change") $Button2 = GUICtrlCreateButton("Exit", 392, 144, 75, 25, 0) GUICtrlSetOnEvent($Button2, "Button2Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func Button1Click() Local $i = Int(GUICtrlRead($input1)) If Int($i) < 1 Then $i = 1 Run("GhostSrv.exe D:\FTPCACHE\FILES\Images\DELL\LAPTOP\D630\D630V8STDDEC09.GHO clone -n" & $i) EndFunc Func Button2Click() Exit EndFunc Func Input1Change() EndFunc Yes that is Exactly was I was looking for. I just finish testing and worked Perfect Thank you for your quick assistance. Edited February 1, 2010 by jtouma 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