Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This message calculates the approximate width and height required to display a specified number of items.

Syntax

LVM_APPROXIMATEVIEWRECT 
wParam = (WPARAM)(INT) 
iCount;

lParam = (LPARAM) MAKELPARAM(
cx, 
cy);

Parameters

iCount

Number of items to be displayed in the control. If this parameter is set to –1, the message uses the total number of items in the control.

cxand cy

Specify the proposed dimensions of the control, in pixels. Either parameter can beset to –1 to allow the message to use the current width or height value.

Return Value

Returns a DWORDvalue that holds the approximate width and height needed to display the items, in pixels.

Remarks

Setting the size of the list-view control based on the dimensions provided by this message can optimize redraw and reduce flicker.

Requirements

Header commctrl.h
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also