windows_programming_notes.nbk: Home | Index | Next Page: WM_MENUCHAR | Previous Page: WM_MDISETMENU


 WM_MEASUREITEM

The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.

A window receives this message through its WindowProc function.

Parameters

Return Value

If an application processes this message, it should return TRUE.

Remarks

When the owner window receives the WM_MEASUREITEM message, the owner fills in the MEASUREITEMSTRUCT structure pointed to by the lpMeasureItem parameter of the message and returns; this informs the system of the dimensions of the control. If a list box or combo box is created with the LBS_OWNERDRAWVARIABLE or CBS_OWNERDRAWVARIABLE style, this message is sent to the owner for each item in the control; otherwise, this message is sent once.

The system sends the WM_MEASUREITEM message to the owner window of combo boxes and list boxes created with the OWNERDRAWFIXED style before sending the WM_INITDIALOG message. As a result, when the owner receives this message, the system has not yet determined the height and width of the font used in the control; function calls and calculations requiring these values should occur in the main function of the application or library.

Notification Requirements


windows_programming_notes.nbk: Home | Index | Next Page: WM_MENUCHAR | Previous Page: WM_MDISETMENU


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time