[API]
LVITEM
SendMessageA
SendMessageW

[CODE]
Public Sub ListView_Item_SetSingleSelected(ByVal hWndListView As Long, ByVal ItemID As Long, Optional ByVal EnsureVisible As Boolean)
  Dim xType1 As LVITEM

  xType1.stateMask = &H3&
  xType1.state = &H3& 'also focus
  If IsUnicode Then
    Call SendMessageW(hWndListView, &H102B&, ItemID, xType1)
    Else
    Call SendMessageA(hWndListView, &H102B&, ItemID, xType1)
    End If
  If EnsureVisible Then
    If IsUnicode Then
      Call SendMessageW(hWndListView, &H1013&, ItemID, ByVal 0&)
      Else
      Call SendMessageA(hWndListView, &H1013&, ItemID, ByVal 0&)
      End If
    End If
  End Sub
