I'm trying to write an autoit script to select from the dropdown list as you see in the attached picture.
I read the help page for _IEFormElementOptionSelect, but I cannot grasp how to correlate that with the source code that I'm seeing. any suggestions?
So I'm needing a (better) way to get the selection in an edit control, while knowing which end of the selection is active vs anchor (ie, if you're holding shift while moving with the arrow keys, which end of the selection is moving and which is not). Since _GUICtrlEdit_GetSel() only returns the start and end positions, in the order of smallest to largest, if you were to pass that back to the _GUICtrlEdit_SetSel(), the user's selection could end up "backwards".
My solution has been this function:
Func _GUICtrlEdit_GetSelByAnchor($hWnd) ; Get selection range with anchor in first index If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $aActive, $aSelection = _GUICtrlEdit_GetSel($hWnd) ; Get base selection If $aSelection <> $aSelection Then ; Only proceed if actual selection range _GUICtrlEdit_SetSel($hWnd, -1, 0) ; Deselect, leaving only the active point $aActive = _GUICtrlEdit_GetSel($hWnd) ; Record the active point If $aActive = $aSelection Then ; If the active point is equal to the original first index ; Swap the original selection points (putting the anchor in  and active in ) $aSelection = $aSelection $aSelection = $aActive EndIf _GUICtrlEdit_SetSel($hWnd, $aSelection, $aSelection) ; Reset selection to the original points EndIf Return $aSelection EndFunc The problem with this, as you may have already guessed from the two SetSel calls, is that calling it in a tight loop causes a lot of flickering. Is there a better, more reliable way to do what I'm looking for?
I have a GUI with an edit-field and a button.
First I write some text into the edit-field and select a part of it. After that I press the button, and the selection is edited.
How would I do that, though? When the text is selected and I press the button, it's unselected before the button actually raises an event.
I'm trying to read an excel spreadsheet(SWW_TestFlow, Worksheet=Controller) and creating a dropdown list from all the cell values within a specific column("G").
I would like to have the dropdown behave in such a way as to allow multiple selections and for all those selections to be written to a file.
I attached a file I started with to experiment with gui and controls etc but got totally lost.......
Can somebody help me?
I've never worked with an array or dropdown menu before and I can't seem to wrap it around my head this morning. Maybe I just need more coffee but I'm trying to populate a GUI dropdown menu with section names of a .ini file. Here is what I have for this part but I don't know where to go from here. The msgbox thing was only testing it but I kinda got stuck here.
local $aSectionnames = IniReadSectionNames(@DesktopDir & "\Scripts\BatteryConfig.ini") if Not @error Then For $i = 1 to $aSectionnames MsgBox($MB_SYSTEMMODAL, "Test", $aSectionnames[$i]) Next EndIf
Here is my very basic dropdown menu I want to populate
#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 413, 213, 192, 124) $Combo1 = GUICtrlCreateCombo("Combo1", 80, 24, 241, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Button1 = GUICtrlCreateButton("Button1", 152, 56, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd