◄CWnd► ◄Up► ◄Contents► ◄Index► ◄Back► ──Microsoft Foundation Classes────────────────────────────────────────────── afx_msg void OnMeasureItem( LPMEASUREITEMSTRUCT lpMeasureItemStruct ); Parameter Description <lpMeasureItemStruct> Specifies a long pointer to a ◄MEASUREITEMSTRUCT► data structure that contains the dimensions of the owner-draw control. Remarks Called for the owner of an owner-draw button, combo box, list box, or menu item when the control is created. When the owner receives the call, the owner should fill in the ◄MEASUREITEMSTRUCT► data structure pointed to by <lpMeasureItemStruct> and return; this informs Windows of the dimensions of the control and allows Windows to process user interaction with the control correctly. If a list box or combo box is created with the ◄LBS_OWNERDRAWVARIABLE► or ◄CBS_OWNERDRAWVARIABLE► style, this function is called for the owner for each item in the control; otherwise, this function is called once. Windows calls OnMeasureItem for the owner 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 call, Windows 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. This message-handler member function calls the ◄Default► member function. Override this member function in your derived class to handle the ◄WM_MEASUREITEM► message. See Also ◄WM_INITDIALOG►, ◄CWnd::Default►, ◄WM_MEASUREITEM► -♦-