ListView_GetItemRect macro (commctrl.h)

Gets the bounding rectangle for all or part of an item in the current view. You can use this macro or send the LVM_GETITEMRECT message explicitly.

Syntax

void ListView_GetItemRect(
  [in]   hwnd,
  [in]   i,
  [out]  prc,
  [in]   code
);

Parameters

[in] hwnd

Type: HWND

A handle to the list-view control.

[in] i

Type: int

The index of the list-view item.

[out] prc

Type: RECT*

A pointer to a RECT structure that receives the bounding rectangle.

[in] code

Type: int

The portion of the list-view item from which to retrieve the bounding rectangle. This parameter must be one of the following values:

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 item text.
LVIR_SELECTBOUNDS
Returns the union of the LVIR_ICON and LVIR_LABEL rectangles, but excludes columns in report view.

Return value

None

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header commctrl.h