Alexnoir Posted May 15, 2020 Posted May 15, 2020 Hi, I get empty values.How to get text from a list?Thank. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <GuiListView.au3> $hWin = WinGetHandle('[Title:My_arh]') $hTC = ControlGetHandle($hWin, '', '[CLASS:SysListView32; INSTANCE:1]') $idListview = ControlGetHandle($hWin, '', '[CLASS:SysListView32; INSTANCE:1]') MsgBox($MB_SYSTEMMODAL, "Information", "Text: " & _GUICtrlListView_GetItemText($idListview, 1)) MsgBox($MB_SYSTEMMODAL, "Information", "String: " & @CRLF & @CRLF & _GUICtrlListView_GetItemTextString($idListview, 4))
SirAlonne Posted May 15, 2020 Posted May 15, 2020 (edited) expandcollapse popup#AutoIt3Wrapper_UseX64=Y ; use x64 for x64 applications otherwise comment this part out #include <GuiListView.au3> Opt("WinTitleMatchMode", -2) ; caselessly match any substring in the title _GetListViewText("My_arh") Func _GetListViewText($WindowTitle) Local $WinHwnd, $ControlHwnd, $Columns, $Items, $Row If Not WinExists($WindowTitle) Then Return SetError(1) EndIf While WinExists($WindowTitle) $WinHwnd = WinGetHandle($WindowTitle) If @error Then ContinueLoop EndIf $ControlHwnd = ControlGetHandle($WinHwnd, "", "[CLASS:SysListView32; INSTANCE:1]") If @error Then ContinueLoop EndIf $Columns = _GUICtrlListView_GetColumnCount($ControlHwnd) $Items = _GUICtrlListView_GetItemCount($ControlHwnd) ExitLoop WEnd For $Column = 0 To $Columns Step 1 For $Index = 0 To $Items Step 1 $Row = _GUICtrlListView_GetItemText($ControlHwnd, $Index, $Column) If Not $Row Then ContinueLoop EndIf MsgBox(0, "Results", "Column = " & $Column & @CRLF & _ "Index = " & $Index & @CRLF & _ "Text = " & $Row) Next Next Return 1 EndFunc ;==>_GetListViewText Edited May 15, 2020 by SirAlonne
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