danghoan83 Posted September 18, 2017 Posted September 18, 2017 I have a Window Info (of an application installed on the windows operating system) as follows: Title Dialog Class ListBox Instance 1 ClassnameNN ListBox1 ID 1660 ............ You help me get all the item prices in the msgbox output (each item per line). Thank you very much P/S: I am Vietnamese and my English is not good. I have Google translator. I'm sorry.
careca Posted September 18, 2017 Posted September 18, 2017 (edited) Since you have no code at all, maybe this can give you a push. Keep in mind it's not specific for your issue. You have to change the class of window for whatever it is right now, and the SysListView321 to the value you get from the info tool. $hWnd = WinGetHandle("[CLASS:WINDOWTHATHASTHELISTBOX]", "") $iCount = ControlListView($hWnd, "", "SysListView321", "GetItemCount") For $k = 0 To $iCount - 1 $sText1 = ControlListView($hWnd, "", "SysListView321", "GetText", $k, 0) ConsoleWrite('Line - ' & $k & ' - ' & $sText1 & @CRLF) Next Edited September 18, 2017 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
danghoan83 Posted September 19, 2017 Author Posted September 19, 2017 (edited) 16 hours ago, careca said: Vì bạn không có mã nào, có lẽ điều này có thể giúp bạn đẩy nhanh. Lưu ý rằng vấn đề của bạn không cụ thể. Bạn phải thay đổi lớp cửa sổ cho bất cứ điều gì ngay bây giờ, và SysListView321 với giá trị bạn nhận được từ công cụ thông tin. $ hWnd = WinGetHandle ( "[CLASS: WINDOWTHATHASTHELISTBOX]" , "" ) $ iCount = ControlListView ( $ hWnd , "" , "SysListView321" , "GetItemCount" ) Đối với $ k = 0 Để $ iCount - 1 $ sText1 = ControlListView ( $ hWnd , "" , "SysListView321" , "GetText" , $ k , 0 ) ConsoleWrite ( 'Dòng - ' & $ k & '-' & $ sText1 & @CRLF ) Tiếp theo I so sorry. Here is the details of the window. Can you help you move items into the array instead of ConsoleWrite? ConsoleWrite does not show anything. (Sorry, I know a little bit about autoit) Edited September 19, 2017 by danghoan83
careca Posted September 19, 2017 Posted September 19, 2017 Of course it doesn't. What did you change to the code, in order to make it show the values? I would focus on getting it to show the values, and then worry about the array. $hWnd = WinGetHandle("[CLASS:#32770]", "") $iCount = ControlListView($hWnd, "", "ListBox", "GetItemCount") For $k = 0 To $iCount - 1 $sText1 = ControlListView($hWnd, "", "ListBox", "GetText", $k, 0) ConsoleWrite('Line - ' & $k & ' - ' & $sText1 & @CRLF) Next Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
danghoan83 Posted September 20, 2017 Author Posted September 20, 2017 (edited) 17 hours ago, careca said: Of course it doesn't. What did you change to the code, in order to make it show the values? I would focus on getting it to show the values, and then worry about the array. $hWnd = WinGetHandle("[CLASS:#32770]", "") $iCount = ControlListView($hWnd, "", "ListBox", "GetItemCount") For $k = 0 To $iCount - 1 $sText1 = ControlListView($hWnd, "", "ListBox", "GetText", $k, 0) ConsoleWrite('Line - ' & $k & ' - ' & $sText1 & @CRLF) Next I tried but did not see the items. I exported $ iCount but ICount = 0. Can you help me? Edited September 20, 2017 by danghoan83
spudw2k Posted September 20, 2017 Posted September 20, 2017 (edited) I think there is a little confusion here. Firstly, a ListBox and a ListView are not the same thing. i wouldn't (necessary) expect the ListView functions to work properly with a ListBox. i think careca mistakenly made a bad recommendation to use the ControlListView function. Look in your help file for the _GUICtrlListBox_* functions (_GetSelItems* might be of particular interest to you). There are some good examples in there too. Have a look and let us know where you get stuck. Edited September 20, 2017 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
danghoan83 Posted September 20, 2017 Author Posted September 20, 2017 3 hours ago, spudw2k said: I think there is a little confusion here. Firstly, a ListBox and a ListView are not the same thing. i wouldn't (necessary) expect the ListView functions to work properly with a ListBox. i think careca mistakenly made a bad recommendation to use the ControlListView function. Look in your help file for the _GUICtrlListBox_* functions (_GetSelItems* might be of particular interest to you). There are some good examples in there too. Have a look and let us know where you get stuck. Thank you very much. But I do not understand: $ idListBox will equal something in the Listbox. I tried and the results were still nothing. I'm so bad. #include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <MsgBoxConstants.au3> WinWaitActive("Dialog") $idListBox = WinGetHandle("[CLASS:#32770]","") $iCount = _GUICtrlListBox_GetCount($idListBox) ConsoleWrite('iCount = '&$iCount & @CRLF) P/S: iCount = 0
danghoan83 Posted September 20, 2017 Author Posted September 20, 2017 Thanks to everyone, I have found a solution to my problem. Thank you very much for careca and spudw2k. #include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <MsgBoxConstants.au3> ;Dim $i ;Dim $hWindow ;Dim $hControl ;Dim $iCount ;Dim $item WinWaitActive("Dialog") Local $hWindow = WinGetHandle("Dialog") Local $hControl = ControlGetHandle($hWindow, "", "[CLASS:ListBox; INSTANCE:1]") Local $iCount = _GUICtrlListBox_GetCount($hControl) ;Dim $mang[$iCount] Local $item for $i = 0 to $iCount - 1 ConsoleWrite(_GUICtrlListBox_GetText($hControl,$i)& @CRLF) Next
careca Posted September 20, 2017 Posted September 20, 2017 Yeah my bad on the ControlListView. Glad you sorted that out. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
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