Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Please teach it if possible Collapse All
Subject Author Date
tera t Jul 30, 2007 - 2:23 AM

Hello

The button which is included in the Caption inside
I want to acquire the size.
ttp://profuis0.tripod.com/20070730/image01.jpg

I use SM_CXSIZE
However, I cannot acquire it well
Size is too big.

Besides, if there is a good method, please teach it

Technical Support Jul 30, 2007 - 4:21 AM

On Windows XP/Vista you should use the GetThemeInt() API to get the metrics of a particular skinned UI item.

tera t Jul 30, 2007 - 7:59 PM

Hello

I do not understand how to use well.
I cannot acquire size well.
Please teach it

BOOL CMuResizableDialog::OnInitDialog()
{
VERIFY( CExtNCW < CExtResizableDialog >::OnInitDialog() );

g_PaintManager.m_UxTheme.OpenThemeData(
this->m_hWnd,
VSCLASS_WINDOW
);

int iVal=-1;
g_PaintManager.m_UxTheme.
GetThemeInt( WP_MAXBUTTON , 0 , TMT_WIDTH , &iVal );

return TRUE; // return TRUE unless you set the focus to a control
}

Technical Support Jul 31, 2007 - 9:00 AM

The following method computes the desired size on Windows XP and should work on Vista:

HRESULT hr;
HANDLE hTheme = g_PaintManager.m_UxTheme.OpenThemeData( m_hWnd, VSCLASS_WINDOW );
ASSERT( hTheme != NULL );
SIZE sizeVal = { 0, 0 };
CWindowDC dc( this );
hr = g_PaintManager.m_UxTheme.GetThemePartSize( dc, WP_MAXBUTTON, SBS_NORMAL, NULL, CExtUxTheme::__EXT_UX_TS_TRUE, &sizeVal );
ASSERT( hr == S_OK );
dc.DeleteDC();
g_PaintManager.m_UxTheme.CloseThemeData();
On Vista, Microsoft forums recommend to use the new WM_GETTITLEBARINFOEX message.



tera t Aug 1, 2007 - 12:34 AM

Hello.

Windows 2000, NT
Should I use the following orders?

SM_CXSIZE
SM_CYSIZE

Technical Support Aug 1, 2007 - 11:25 AM

Yes, you should use them on older Windows OS versions.