#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <Array.au3>
$iItems = 10000;Random(9000, 10000, 1)
$iRows = 3;Random(3, 6, 1)
Dim $aItems[$iItems][$iRows]
For $i = 0 To UBound($aItems) - 1 ;или $iItems - 1
For $j = 0 To UBound($aItems, 2) - 1 ;или $iRows - 1
$aItems[$i][$j] = 'Item ' & $i + 1 & '-' & $j
Next
Next
GUICreate($iItems & 'x' & $iRows, 400, 320)
$nListView = GUICtrlCreateListView('', 2, 2, 394, 268)
$nButton = GUICtrlCreateButton('Получить', 150, 280, 100, 30)
GUISetState()
$iStart = TimerInit()
For $i = 0 To $iRows - 1
_GUICtrlListView_AddColumn($nListView, 'SubItems ' & $i, 100)
Next
_GUICtrlListView_AddArray($nListView, $aItems)
ConsoleWrite(StringFormat('%.2f msec', TimerDiff($iStart)) & @LF)
$aItems = 0
$iItems = 0
$iRows = 0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $nButton
$iStart = TimerInit()
_GUICtrlListView_BeginUpdate($nListView)
$iItems = _GUICtrlListView_GetItemCount($nListView)
$iRows = _GUICtrlListView_GetColumnCount($nListView)
Dim $aItems[$iItems][$iRows]
$fUnicode = _GUICtrlListView_GetUnicodeFormat($nListView)
If $fUnicode Then
$tBuffer = DllStructCreate('wchar Text[4096]')
Else
$tBuffer = DllStructCreate('char Text[4096]')
EndIf
$pBuffer = DllStructGetPtr($tBuffer)
$tItem = DllStructCreate($tagLVITEM)
$pItem = DllStructGetPtr($tItem)
DllStructSetData($tItem, 'TextMax', 4096)
DllStructSetData($tItem, 'Text', $pBuffer)
For $i = 0 To $iItems - 1
For $j = 0 To $iRows - 1
DllStructSetData($tItem, 'SubItem', $j)
If $fUnicode Then
GUICtrlSendMsg($nListView, $LVM_GETITEMTEXTW, $i, $pItem)
Else
GUICtrlSendMsg($nListView, $LVM_GETITEMTEXTA, $i, $pItem)
EndIf
$aItems[$i][$j] = DllStructGetData($tBuffer, 'Text')
Next
Next
_GUICtrlListView_EndUpdate($nListView)
$sTime = StringFormat('%.2f msec', TimerDiff($iStart))
_ArrayDisplay($aItems, $sTime)
$sTime = ''
$aItems = 0
$iItems = 0
$iRows = 0
$fUnicode = 0
$tBuffer = 0
$pBuffer = 0
$tItem = 0
$pItem = 0
EndSwitch
WEnd