donhorn20 Posted March 24, 2020 Posted March 24, 2020 Trying to get this combo box drop down to read the data within my ini section names. Not able to return the key=value data when I hit the button on the gui. I can't seem to get the IniReadSection to recognize anything based off of my selection. What am I missing here? #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #Region ### START Koda GUI section ### Form= ; original script borrowed from InunoTaishou and Subz $Form1 = GUICreate("Sample", 413, 213, 192, 124) $Combo1 = GUICtrlCreateCombo("", 80, 24, 241, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Button1 = GUICtrlCreateButton("Submit", 152, 56, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ; Get the sections of the ini file Global $iFile = @ScriptDir & "\test5.ini" Global $aSections = IniReadSectionNames($iFile) ; If the IniReadSectionNames succeeded, convert the array to a string with each item separated by a | (pipe) and set the default selected item to $aSections[1] If (Not @Error) Then GUICtrlSetData($Combo1, _ArraytoString($aSections, "|", 1), $aSections[1]) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $test = IniReadSection($iFile, $aSections) MsgBox($MB_SYSTEMMODAL, "", $test) EndSwitch WEnd I've attached my sample ini data too. test5.ini
Nine Posted March 24, 2020 Posted March 24, 2020 Replace that line $test = IniReadSection($iFile, $aSections) by $test = _ArrayToString(IniReadSection($iFile, guictrlread ($Combo1)),"=",1) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
donhorn20 Posted October 20, 2023 Author Posted October 20, 2023 Is it possible to take the same ini file, encrypt it ahead of time via _Crypt_ EncryptFile and have my script read those encrypted section names back as plain text within the combo box?
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