From d62dd82efb854cfe8d5dadcabcbc48a36d4c0c32 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Mon, 12 Feb 2001 03:46:00 +0000 Subject: [PATCH] Fix ListView_GetItemRect() macro. Fix use of ListView_GetItemRect() macro in listview control. Add some documentation to LISTVIEW_GetItemRect(). --- dlls/comctl32/listview.c | 11 ++++++++++- include/commctrl.h | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 88d71baf6c3..9fa569b28b3 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -5348,6 +5348,15 @@ static BOOL LISTVIEW_GetItemPosition(HWND hwnd, INT nItem, * [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 @@ static LRESULT LISTVIEW_Update(HWND hwnd, INT nItem) { /* 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 e483cb4e085..1e892b2add3 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -2884,8 +2884,10 @@ typedef struct tagNMLVCUSTOMDRAW (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) \ -- 2.11.4.GIT