BCM_GETIDEALSIZE not supported properly?

I noticed that the BCM_GETIDEALSIZE message does not account for the button text when using WindowBlinds.

For example (using ATL):

CButton button;
button.Create(
parent.m_hWnd,
0,
L"Login",
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
BS_PUSHBUTTON,
0,
IDS_LOGIN);
SIZE size;
size.cx = 0;
size.cy = 0;
button.GetIdealSize(&size);


When not using WindowBlinds size.cx now contains a number that is the width of the button, including the text. But when using WindowBlinds the number is smaller, just big enough to draw the borders of the button, but not the text.

The description of BCM_GETIDEALSIZE is: "Gets the size of the button that best fits its text and image, if an image list is present."

I
1,028 views 0 replies