1 out of 2 rated this helpful - Rate this topic

LVM_GETSUBITEMRECT message

Applies to: desktop apps only

Retrieves information about the bounding rectangle for a subitem in a list-view control. You can send this message explicitly or by using the ListView_GetSubItemRect macro (recommended). This message is intended to be used only with list-view controls that use the LVS_REPORT style.

Parameters

wParam

Index of the subitem's parent item.

lParam

Pointer to a RECT structure that will receive the subitem bounding rectangle information. Its members must be initialized according to the following member/value relationships:

ValueMeaning
top

The one-based index of the subitem.

left

Flag value (see remarks). Indicates the portion of the list-view subitem for which to retrieve the bounding rectangle.

 

Return value

Returns nonzero if successful, or zero otherwise.

Remarks

Following are the flag values that may be set.

Flag Value Meaning
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 entire item, including the icon and label. This is identical to LVIR_BOUNDS.

 

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Commctrl.h

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
First column
> this means that there is no way to find the bounding rectangle of the first sub-item.....

You can get the first Column's width via LVM_GETCOLUMN which returns a valid width for subitem = 0.
The height can be obtained via LVM_GETITEMRECT.
The sub-item index is not 1-based
At least with comctl32.dll v6 the sub-item index is 0-based. In particular, this means that there is no way to find the bounding rectangle of the first sub-item using this function as passing 0 as sub-item retrieves the full item rectangle.