P
Pete Vickers [eMVP]
Hi,
i found some code in the groups to give the functionality of finditem on a
listview in full vb.net and attempted to port it to CF.
Unfortunately, it falls over with System.NotSupportedException when I call
the sendmessage.
Anyone see anything glaringly obvious in the code?
Thanks
Pete
Called as
iRet = Find_ListItem(lvResults, "fred")
Fails at sendmessage
Declare Function SendMessageFindItem Lib "Coredll" Alias "SendMessageW"
(ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer,
ByRef lParam As LVFINDINFO) As Integer
Public Structure POINTAPI
Public x As Integer
Public y As Integer
End Structure
Public Structure LVFINDINFO
Public flags As Integer
Public psz As String
Public lParam As Integer
Public pt As POINTAPI
Public vkDirection As Integer
End Structure
Public Shared Function Find_Listitem(ByVal lv As ListView, ByVal sFind As
String) As Integer
Dim fi As LVFINDINFO
Dim result As Integer
fi.flags = 2 ' LVFI_STRING
fi.psz = sFind
fi.lParam = 0
fi.pt.X = 0
fi.pt.Y = 0
fi.vkDirection = 0
Dim lvHwnd As IntPtr
lv.Capture = True
lvHwnd = GetCapture()
lv.Capture = False
result = SendMessageFindItem(lvHwnd.ToInt32, LVM_FINDITEM, -1, fi)
End Function
i found some code in the groups to give the functionality of finditem on a
listview in full vb.net and attempted to port it to CF.
Unfortunately, it falls over with System.NotSupportedException when I call
the sendmessage.
Anyone see anything glaringly obvious in the code?
Thanks
Pete
Called as
iRet = Find_ListItem(lvResults, "fred")
Fails at sendmessage
Declare Function SendMessageFindItem Lib "Coredll" Alias "SendMessageW"
(ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer,
ByRef lParam As LVFINDINFO) As Integer
Public Structure POINTAPI
Public x As Integer
Public y As Integer
End Structure
Public Structure LVFINDINFO
Public flags As Integer
Public psz As String
Public lParam As Integer
Public pt As POINTAPI
Public vkDirection As Integer
End Structure
Public Shared Function Find_Listitem(ByVal lv As ListView, ByVal sFind As
String) As Integer
Dim fi As LVFINDINFO
Dim result As Integer
fi.flags = 2 ' LVFI_STRING
fi.psz = sFind
fi.lParam = 0
fi.pt.X = 0
fi.pt.Y = 0
fi.vkDirection = 0
Dim lvHwnd As IntPtr
lv.Capture = True
lvHwnd = GetCapture()
lv.Capture = False
result = SendMessageFindItem(lvHwnd.ToInt32, LVM_FINDITEM, -1, fi)
End Function