Fix ListView_GetItemRect() macro.
Fix use of ListView_GetItemRect() macro in listview control.
Add some documentation to LISTVIEW_GetItemRect().
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 88d71ba..9fa569b 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -5348,6 +5348,15 @@
* [I] HWND : window handle
* [I] INT : item index
* [IO] LPRECT : bounding rectangle coordinates
+ * lprc->left specifies the portion of the item for which the bounding
+ * rectangle will be retrieved.
+ *
+ * LVIR_BOUNDS Returns the bounding rectangle of the entire item,
+ * including the icon and label.
+ * LVIR_ICON Returns the bounding rectangle of the icon or small icon.
+ * LVIR_LABEL Returns the bounding rectangle of the item text.
+ * LVIR_SELECTBOUNDS Returns the union of the LVIR_ICON and LVIR_LABEL
+ * rectangles, but excludes columns in report view.
*
* RETURN:
* SUCCESS : TRUE
@@ -7515,7 +7524,7 @@
{
/* get item bounding rectangle */
rc.left = LVIR_BOUNDS;
- ListView_GetItemRect(hwnd, nItem, &rc);
+ ListView_GetItemRect(hwnd, nItem, &rc, rc.left);
InvalidateRect(hwnd, &rc, TRUE);
}
}
diff --git a/include/commctrl.h b/include/commctrl.h
index e483cb4..1e892b2 100644
--- a/include/commctrl.h
+++ b/include/commctrl.h
@@ -2884,8 +2884,10 @@
(INT)SendMessageA((hwnd),LVM_ARRANGE,(WPARAM)(INT)(code),0L)
#define ListView_GetItemPosition(hwnd,i,ppt) \
(INT)SendMessageA((hwnd),LVM_GETITEMPOSITION,(WPARAM)(INT)(i),(LPARAM)(LPPOINT)(ppt))
-#define ListView_GetItemRect(hwnd,i,prc) \
- (INT)SendMessageA((hwnd),LVM_GETITEMRECT,(WPARAM)(INT)(i),(LPARAM)(LPRECT)(prc))
+#define ListView_GetItemRect(hwnd,i,prc,code) \
+ (BOOL)SendMessageA((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), \
+ ((prc) ? (((RECT*)(prc))->left = (code),(LPARAM)(RECT \
+ *)(prc)) : (LPARAM)(RECT*)NULL))
#define ListView_SetItemA(hwnd,pitem) \
(INT)SendMessageA((hwnd),LVM_SETITEMA,0,(LPARAM)(const LVITEMA *)(pitem))
#define ListView_SetItemW(hwnd,pitem) \