VB Code:
  1. Const LVM_FIRST As Long = &H1000
  2. Const LVIF_STATE As Long = &H8
  3. Const LVIS_SELECTED As Long = &H2
  4. Const LVIS_FOCUSED As Long = &H1
  5. Const LVM_SETITEMSTATE As Long = (LVM_FIRST + 8)
  6.  
  7.  
  8. Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" ( _
  9.      ByVal hwnd As Long, _
  10.      ByVal wMsg As Long, _
  11.      ByVal wParam As Long, _
  12.      ByRef lParam As Any) As Long
  13.      
  14. Private Sub Command1_Click()
  15. With myLVitem
  16.       .mask = LVIF_STATE
  17.       .state = &HF
  18.       .stateMask = LVIS_SELECTED Or LVIS_FOCUSED
  19.       End With
  20.      
  21.         dmWriteProcessData lvItemPointer, VarPtr(myLVitem), Len(myLVitem)
  22.         apiResult = SendMessage(lvWindow, LVM_SETITEMSTATE, 1, lvItemPointer)
  23. End Sub

You didn't add the LVM_FIRST declaration that I posted above. The above should work and highlight the first item. For the 2nd item you should use (I'm guessing) :

VB Code:
  1. apiResult = SendMessage(lvWindow, LVM_SETITEMSTATE, 2, lvItemPointer)

For the 3rd item :

VB Code:
  1. apiResult = SendMessage(lvWindow, LVM_SETITEMSTATE, 3, lvItemPointer)

And so on...