ptrex Posted October 25, 2005 Share Posted October 25, 2005 Is it possible to read the data in the ListView to a variable or Array. Without having to select the items by hand in the ListView. Because that' s what all the current function like _GUICtrlListViewGetItemTextArray demand, is a manual selection. Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2005 Share Posted October 25, 2005 (edited) you mean something like? expandcollapse popup#include <GuiConstants.au3> #include <GuiListView.au3> Opt ('MustDeclareVars', 1) Dim $listview, $Btn_Get, $Btn_Exit, $msg, $Status, $ret GUICreate("ListView Get Item Text", 392, 322) $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149) GUICtrlCreateListViewItem("line1|data1|more1", $listview) GUICtrlCreateListViewItem("line2|data2|more2", $listview) GUICtrlCreateListViewItem("line3|data3|more3", $listview) GUICtrlCreateListViewItem("line4|data4|more4", $listview) GUICtrlCreateListViewItem("line5|data5|more5", $listview) $Btn_Get = GUICtrlCreateButton("Get data", 75, 200, 90, 40) $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30) $Status = GUICtrlCreateLabel("", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER)) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $Btn_Get GUICtrlSetData($Status, "") Local $a_list, $x For $x = 0 To _GUICtrlListViewGetItemCount($listview) - 1 If IsArray($a_list) Then ReDim $a_list[UBound($a_list) + 1] Else Dim $a_list[1] EndIf $a_list[UBound($a_list) - 1] = _GUICtrlListViewGetItemText ($listview, $x) Next For $x = 0 To UBound($a_list) - 1 MsgBox(0,"a_list[" & $x & "]",$a_list[$x]) Next EndSelect WEnd Exit Edited October 25, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
ptrex Posted October 25, 2005 Author Share Posted October 25, 2005 Hihaaaaa, that' s it !! This is a good suggestion for a standard UDF. Because I thought that the functions like _GUICtrlListViewGetItemText would read all or part, of the data from the ListView. As it is said in the Helpfile text Found out later on that it only read the data, after manually selecting it. So you solution is missing as a standard function. Maybe usefull for many others. May come handy when people working with listView, want to read the data for what ever reason, and use it later on. I will incorporate your solution in the SQL solution, for exporting data from a ListView to a file or Excel. Thanks a lot !! Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
tonedeaf Posted October 25, 2005 Share Posted October 25, 2005 @ptrexBecause I thought that the functions like _GUICtrlListViewGetItemText would read all or part, of the data from the ListView. As it is said in the Helpfile textFound out later on that it only read the data, after manually selecting itYou were right on the first part. _GUICtrlListViewGetItemText() dosen't need any ListView items to be selected. The script by gafrost is not selecting any ListView items.The second part is not correct. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2005 Share Posted October 25, 2005 (edited) now that i had some coffee and am awake, didn't need as many lines of code to get the data Local $a_list[_GUICtrlListViewGetItemCount($listview)], $x For $x = 0 To _GUICtrlListViewGetItemCount($listview) - 1 $a_list[$x] = _GUICtrlListViewGetItemText ($listview, $x) Next For $x = 0 To UBound($a_list) - 1 MsgBox(0,"a_list[" & $x & "]",$a_list[$x]) Next Edited October 25, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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