Col_Blimp
Col_Blimp

Reputation: 789

ListView row non column rectangle

Say I have a Windows ListView with two columns then I can get the Rec of the row with LVM_GETITEMRECT but that Rec does not include the area of the ListView not covered by a column, how do I determine this rectangle area so I can draw in it?

enter image description here

In the picture the area I want is the blue highlighting to the right that has no column, this is basically just to have full row selection looking like its full row.

Upvotes: 0

Views: 162

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 595961

Once you obtain the row's RECT, simply change its right field to be the same value as the width of the ListView's client area.

RECT rectRow;
ListView_GetItemRect(hListView, iRow, &rectRow, LVIR_BOUNDS);

RECT rectCli;
GetClientRect(hListView, &rectCli);

rectRow.right = (rectCli.right - rectCli.left);

Upvotes: 1

Related Questions