[API]
SendMessageW
SendMessageA
LocalAlloc
LocalFree
LVITEM

[INCLUDE]
PeekS
ListView

[CODE]
Public Function ListView_Item_GetText(ByVal hWndListView As Long, ByVal ItemID As Long, ByVal SubItem As Long) As String
  Dim xType1 As LVITEM

  xType1.pszText = LocalAlloc(0&, ptrTempSizeX + 1&)
  If Not xType1.pszText = 0& Then
    xType1.mask = &H1&
    'xType1.iItem = ItemID
    xType1.iSubItem = SubItem
    If IsUnicode Then
      xType1.cchTextMax = ptrTempSizeXW
      ItemID = SendMessageW(hWndListView, &H1073&, ItemID, xType1)
      Else
      xType1.cchTextMax = ptrTempSizeX
      ItemID = SendMessageA(hWndListView, &H102D&, ItemID, xType1)
      End If
    If Not ItemID = 0& Then ListView_Item_GetText = PeekS(xType1.pszText, ItemID)
    Call LocalFree(xType1.pszText)
    End If
  End Function