There should not be problems with creating you controls compatible with Prof-UIS themes. However, there are two issues we would like to draw you attention to.
1. You should get colors using the g_PaintManager->GetColor()
method rather than ::GetSysColor()
:
g_PaintManager->GetColor( COLOR_3DSHADOW )
2. Your painting procedure generally should look like:
CRect rcClient;
GetClientRect( &rcClient );
if( rcClient.IsRectEmpty() )
return;
CPaintDC dcPaint( this );
CExtMemoryDC dc(
&dcPaint,
&rcClient
);
CRgn rgnClient;
if( rgnClient.CreateRectRgnIndirect( &rcClient ) )
dc.SelectClipRgn( &rgnClient );
// ...
// ...
// PLACE YOUR PAINTING CODE HERE
// ...
// ...
if( rgnClient.GetSafeHandle() != NULL )
dc.SelectClipRgn( &rgnClient );
For example you can use the following code to make your control’s background consistent with the current theme:
bool bTransparent = false;
if( (! bTransparent )
&& PmBridge_GetPM()->GetCb2DbTransparentMode(this)
)
{
CExtPaintManager::stat_ExcludeChildAreas(
dc,
GetSafeHwnd(),
CExtPaintManager::stat_DefExcludeChildAreaCallback
);
if( PmBridge_GetPM()->PaintDockerBkgnd( true, dc, this ) )
bTransparent = true;
}
if( ! bTransparent )
dc.FillSolidRect(
&rcClient,
PmBridge_GetPM()->GetColor( CExtPaintManager::CLR_3DFACE_OUT, this )
);