Export (0) Print
Expand All

Button_GetIdealSize macro

Gets the size of the button that best fits the text and image, if an image list is present. You can use this macro or send the BCM_GETIDEALSIZE message explicitly.

Syntax


BOOL Button_GetIdealSize(
  HWND hwnd,
  SIZE *pSize
);

Parameters

hwnd

Type: HWND

A handle to the button control.

pSize

Type: SIZE*

A pointer to a SIZE structure that receives the desired size of the button including the text and image list if present.

Return value

If the macro succeeds, it returns TRUE. Otherwise it returns FALSE.

Remarks

This macro is most applicable to PushButtons. When sent to a PushButton, the macro retrieves the bounding rectangle required to display the button's text. And, if the PushButton has an image list, the bounding rectangle is also sized to include the button's image.

When sent to a button of any other type, the size of the control's window rectangle is retrieved.

Note  To use this macro, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Commctrl.h

See also

Reference
BCM_GETIDEALSIZE
Other Resources
SIZE

 

 

Community Additions

ADD
Show:
© 2014 Microsoft