Private Function GetItemRect(hWnd As Long, ByVal Index As Long) As RECT
GetItemRect.X1 = LVIR_BOUNDS
Call SendMessage(hWnd, LVM_GETITEMRECT, Index, GetItemRect)
End Function
GetItemRect returns information about the location of a listview item. By default, GetItemRect returns the rectangle. The rectangle returned includes the item’s X and Y position relative to the listview, its width, and its height.
If the item is currently scrolled out of view, the returned coordinates will reflect this. For example, if item 1 is specified, and the top item visible is item 10, then the Y coordinate returned is a negative number.
Reversely, how to get the Row index by giving the rectangle Coordinate?
for example:
Top visible Row is 10, Listview got Scrollbar
I use GetItemRect(m_hListview,0) to retrieve the first Row #0's rectangle, it returns (0, -303, 450, -270 ).
1. My question is how to use API to determine (0, -303, 450, -270 ) is Row #0?
2. I want to determine (0,-290,450,-298) is in which of Row (apparently, it is in ROW 0).