sliwek Posted March 20, 2012 Share Posted March 20, 2012 (edited) Hi i trying to make makro to run program (instalation) from other PC and have problem with GUICtrlRead in Install function. It wont read my choose from Gui, dont know why. ---------------------------- edit: Ok found problem. Edited March 20, 2012 by sliwek Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 20, 2012 Moderators Share Posted March 20, 2012 sliwek, You had the combos the wrong way round and so you were not reading the correct one. This works for me: expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form= ;_listy() $Form1 = GUICreate("Wertest", 396, 206, 275, 122) $exeWertest = GUICtrlCreateCombo("", 40, 40, 201, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Finanse|Fundusz", "") $Button1 = GUICtrlCreateButton("Instaluj", 256, 40, 105, 25) $Label1 = GUICtrlCreateLabel("Wertest", 40, 16, 41, 17) $Label2 = GUICtrlCreateLabel("Wertest demo", 40, 80, 70, 17) $exeWertestDemo = GUICtrlCreateCombo("", 40, 96, 201, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Finanse|Fundusz", "") $Button2 = GUICtrlCreateButton("Instaluj", 256, 96, 105, 25) $Button3 = GUICtrlCreateButton("Zamknij", 256, 144, 105, 41) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button3 Exit Case $Button1 install() Case $Button2 installdemo() EndSwitch ;Global $profil = GUICtrlRead($profilinput) WEnd Func _listy() $var = IniReadSectionNames("settings.ini") If @error Then wypelnijliste() EndIf EndFunc ;==>_listy Func wypelnijliste() IniWrite("settings.ini", "wertest", "Finanse", "serwerinstalkiFinanseFinanse.exe") IniWrite("settings.ini", "wertest", "Fundusz", "serwerinstalkiFunduszFundusz.exe") EndFunc ;==>wypelnijliste Func install() $program = GUICtrlRead($exeWertest) MsgBox(0, "Install", $program) ;IniWrite("settings.ini", "test", "Finanse DDJ", GUICtrlRead($exeWertest)) ;$file = IniRead("settings.ini", "wertest", $program, "Not found") ;MsgBox(0, "instal", "Instaluje " & $program & " z lokalizacji: " & @LF & $file) ;Run($file) EndFunc ;==>install Func installdemo() $program = GUICtrlRead($exeWertestDemo) MsgBox(0, "Demo", $program) ;$file = IniRead("settings.ini", "wertestDemo", $program, "Not found") ;Run($file) EndFunc ;==>installdemo M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sliwek Posted March 20, 2012 Author Share Posted March 20, 2012 (edited) thx yea also saw that, but have another one problem. when i chose "fundusz" and press install it still show me "finanse". dont know how refresh it. Edited March 20, 2012 by sliwek Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 20, 2012 Moderators Share Posted March 20, 2012 sliwek, The code I posted above does not have that problem. What code are you using? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sliwek Posted March 20, 2012 Author Share Posted March 20, 2012 (edited) Yea i see it's work in ur code, cant find diferents in GUICreate code expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= listy() $Form1 = GUICreate("Wertest", 396, 206, 275, 122) $exeWertest = GUICtrlCreateCombo("", 40, 96, 201, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Finanse|Fundusz", "Finanse") $Button1 = GUICtrlCreateButton("Instaluj", 256, 40, 105, 25) $Label1 = GUICtrlCreateLabel("Wertest", 40, 16, 41, 17) $Label2 = GUICtrlCreateLabel("Wertest demo", 40, 80, 70, 17) $exeWertestDemo = GUICtrlCreateCombo("", 40, 40, 201, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Finanse|Fundusz", "Finanse") $Button2 = GUICtrlCreateButton("Instaluj", 256, 96, 105, 25) $Button3 = GUICtrlCreateButton("Zamknij", 256, 144, 105, 41) $Button4 = GUICtrlCreateButton("Linki do plików", 48, 152, 105, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE,$Button3 Exit Case $Button1 install() Case $Button2 installdemo() Case $Button4 EndSwitch WEnd Func Listy() $var = IniReadSectionNames("settings.ini") If @error Then wypelnijliste() EndIf EndFunc Func wypelnijliste() IniWrite("settings.ini","wertest","Finanse","serwerinstalkiFinanse9.0000Finanse.exe") IniWrite("settings.ini","wertest","Fundusz","serwerinstalkiFundusz5.0006Fundusz.exe") EndFunc Func install() $program = GUICtrlRead($exeWertest) $file = IniRead("settings.ini","wertest",$program,"Not found") MsgBox(0,"instal", "Instaluje " & $program & " z lokalizacji: "& @LF & $file) ;Run($file) EndFunc Func installdemo() $program = GUICtrlRead($exeWertestDemo) $file = IniRead("settings.ini","wertestDemo",$program,"Not found") ;Run($file) EndFunc Edited March 20, 2012 by sliwek Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 20, 2012 Moderators Share Posted March 20, 2012 sliwek, You still have the combos the wrong way round in that code so that you are reading the other combo when you press a button - that is why it does not change. Look at the Y coordinates I used in my code and those you have used. When you get the correct combo in the correct place it works. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sliwek Posted March 20, 2012 Author Share Posted March 20, 2012 ha ha ha THX 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