
retreive text from listview item using API calls?
I would like to know how to retreive text from listview item using API
calls.
I tried LVM_GETITEMTEXT, but VB returns an error or explorer cause an
illegal operation!
Can anyone tell me what i'm doing wrong please??
Private Type LVITEM
mask As Long
iItem As Long
iSubItem As Long
State As Long
stateMask As Long
pszText As String
cchTextMax As Long
iImage As Long
lParam As Long
iIndent As Long
End Type
Private Const LVM_FIRST As Long = &H1000
Private Const LVM_GETITEMTEXT As Long = (LVM_FIRST + 45)
Private Const LVM_GETCOLUMNORDERARRAY As Long = (LVM_FIRST + 59)
Private Const LVIF_TEXT As Long = &H1
Private Const LVM_GETTITEMCOUNT& = (&H1000 + 4)
Private Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
-----------------------------------------------------------------------
dim LV as LVITEM
With LV
.mask = LVIF_TEXT
.iSubItem = 0
.cchTextMax = 255
.pszText = Space$(255)
End With
r = SendMessageAny(LV_Hwnd, LVM_GETITEMTEXT, idxItem, LV)
strText = Left((LV.pszText), Len(LV.pszText) - 1)