TreeView_GetItemRect macro (commctrl.h)

Retrieves the bounding rectangle for a tree-view item and indicates whether the item is visible. You can use this macro or send the TVM_GETITEMRECT message explicitly.

Syntax

BOOL TreeView_GetItemRect(
   HWND      hwnd,
   HTREEITEM hitem,
   LPRECT    prc,
   BOOL      code
);

Parameters

hwnd

Type: HWND

Handle to the tree-view control.

hitem

Type: HTREEITEM

Handle to the tree-view item.

prc

Type: LPRECT

Pointer to a RECT structure that receives the bounding rectangle. The coordinates are relative to the upper-left corner of the tree-view control.

code

Type: BOOL

Value specifying the portion of the item for which to retrieve the bounding rectangle. If this parameter is TRUE, the bounding rectangle includes only the text of the item. Otherwise, it includes the entire line that the item occupies in the tree-view control.

Return value

Type: BOOL

If the item is visible and the bounding rectangle is successfully retrieved, the return value is TRUE. Otherwise, the TVM_GETITEMRECT message returns FALSE and does not retrieve the bounding rectangle.

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