WinXListView_GetItemFromPoint


iItem = WinXListView_GetItemFromPoint (hLV, x, y)

Get the index of the item under a point in a list view control

Parameter Description
hLV The handle to the list view control to get the item from
x The x coordinate of the point, relative to the list view control
y The y coordinate of the point, relative to the list view control

Returns

The index of the item under the specified point or -1 if there is no item under that point. -1 is also returned if there is an error.

Remarks

You can use this function to get the item under the mouse cursor. This is very handy for finding out which item an onItem callback refers to.

Examples

' find the item under the mouse
WinXGetMousePos (hLV, @x, @y)
iItem = WinXListView_GetItemFromPoint (hLV, x, y)

Related Links

WinXListView_GetItemText
WinXListView_GetSelection
onItem (Callback)
WinXGetMousePos