[PATCH] comctl32/listview: Implement GetSelectedColumn

Nikolay Sivov nsivov at codeweavers.com
Wed Dec 26 00:31:41 CST 2018


On 12/26/18 4:23 AM, Isira Seneviratne wrote:

> +static UINT LISTVIEW_GetSelectedColumn(const LISTVIEW_INFO* infoPtr)
> +{
> +    UINT selectedColumn = -1;
> +    INT i;
> +    LVITEMW lvItem;
> +
> +    for (i = 0; i < infoPtr->nItemCount; i++)
> +    {
> +        if (LISTVIEW_GetItemState(infoPtr, i, LVIS_SELECTED))
> +        {
> +            LISTVIEW_GetItemW(infoPtr, &lvItem);
> +            selectedColumn = lvItem.iSubItem;
> +            break;
> +        }
> +    }
> +
> +    TRACE("selectedColumn=%d\n", selectedColumn);
> +    return selectedColumn;
> +}

Have you tested this?I'd expect iSubItem to always be 0 in this case, 
and selection is per-column property anyway, why would it depend on item 
state?

> diff --git a/include/commctrl.h b/include/commctrl.h
> index 73bb9fa3ad..6948650de0 100644
> --- a/include/commctrl.h
> +++ b/include/commctrl.h
> @@ -4123,7 +4123,7 @@ typedef struct NMLVSCROLL
>   #define ListView_SetInfoTip(hwndLV, plvInfoTip)\
>       (BOOL)SNDMSG((hwndLV), LVM_SETINFOTIP, (WPARAM)0, (LPARAM)plvInfoTip)
>   #define ListView_GetSelectedColumn(hwnd) \
> -    (UINT)SNDMSG((hwnd), LVM_GETSELECTEDCOLUMN, 0, 0)
> +    (UINT)SNDMSGA((hwnd), LVM_GETSELECTEDCOLUMN, 0, 0)
>   #define ListView_IsGroupViewEnabled(hwnd) \
>       (BOOL)SNDMSG((hwnd), LVM_ISGROUPVIEWENABLED, 0, 0)
>   #define ListView_GetOutlineColor(hwnd) \

This is incorrect.

Most of this patch is whitespace changes, I'm assuming it was 
accidental, we don't apply automated formatting changes like that.




More information about the wine-devel mailing list