[API]
SendMessageW
SendMessageA
LocalFree
LVITEM
InitCommonControlsExType
InitCommonControlsEx

[INCLUDE]
LocalAllocFromString

[CODE]
Public Function ListView_Item_Add(ByVal hWndListView As Long, ByVal Text As String, Optional ByVal lParam As Long, Optional ByVal ImageID As Long) As Long
  Dim xType1 As LVITEM
  
  With xType1
    .pszText = LocalAllocFromString(Text)
    If Not .pszText = 0& Then
      .mask = &H7&
      .lParam = lParam
      .iImage = ImageID
      .iItem = &H7FFFFFFF
      If IsUnicode Then
        ListView_Item_Add = SendMessageW(hWndListView, &H104D&, 0&, xType1)
        Else
        ListView_Item_Add = SendMessageA(hWndListView, &H1007&, 0&, xType1)
        End If
      Call LocalFree(.pszText)
      End If
    End With
  End Function