You can provide buttons in the resizable property sheet with a look of the classic buttons but the solution is a bit tricky. You need to use a CExtResizablePropertySheet
-derived class in which Prof-UIS buttons should not be subclassed by the parent class:
LRESULT C_YOUR_ResizablePropertySheet::
WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
if( message == (WM_USER+10) && (!bSheetInitialized) )
{
m_bSheetInitialized = true;
CRect rcWnd;
GetWindowRect( &rcWnd );
CSize sizeWnd = rcWnd.Size();
SetMinTrackSize( sizeWnd );
::SetWindowPos(
m_hWnd, NULL, 0,0,0,0,
SWP_NOSIZE|SWP_NOMOVE
|SWP_NOZORDER|SWP_NOOWNERZORDER
|SWP_NOREPOSITION
|SWP_FRAMECHANGED
);
CTabCtrl * pTabCtrl = CExtResPS::GetTabControl();
CWnd * pWnd = GetWindow( GW_CHILD );
for( ; pWnd != NULL; pWnd = pWnd->GetWindow(GW_HWNDNEXT) )
{
if( pTabCtrl == pWnd )
{
pTabCtrl->ModifyStyle( 0, WS_CLIPSIBLINGS );
AddAnchor( pTabCtrl->GetSafeHwnd(), __RDA_LT, __RDA_RB );
continue;
}
CExtSafeString sClassName;
::GetClassName(
pWnd->GetSafeHwnd(),
sClassName.GetBuffer( _MAX_PATH+1 ),
_MAX_PATH
);
sClassName.ReleaseBuffer();
sClassName.MakeLower();
if( sClassName == LPCTSTR( _T("static") ) )
{
pWnd->ModifyStyle( 0, WS_CLIPSIBLINGS );
#if _MFC_VER >= 0x700
if( (m_psh.dwFlags&PSH_WIZARD97) != 0 )
{
if( pWnd->GetDlgCtrlID() == 0x3027 )
{
AddAnchor(
pWnd->GetSafeHwnd(),
__RDA_LT,
__RDA_RT
);
continue;
}
}
#endif // #if _MFC_VER >= 0x700
AddAnchor(
pWnd->GetSafeHwnd(),
__RDA_LB,
__RDA_RB
);
continue;
}
} // for( ; pWnd != NULL; pWnd = pWnd->GetWindow(GW_HWNDNEXT) )
_SyncActivePage();
CExtPaintManager::monitor_parms_t _mp;
CExtPaintManager::stat_GetMonitorParms( _mp, this );
SetMaximizedRect( &_mp.m_rcWorkArea );
SetMaxTrackSize( _mp.m_rcWorkArea.Size() );
CRect _rcWnd;
GetWindowRect( &_rcWnd );;
CSize _size = _rcWnd.Size();
::SendMessage(
m_hWnd, WM_SIZE,
WPARAM(SIZE_RESTORED),
MAKELPARAM( _size.cx, _size.cy )
);
if( GetStyle() & WS_VISIBLE )
RedrawWindow();
OnResizablePropertySheetInitialized();
return 0L;
}
return
CExtResizablePropertySheet::
WindowProc(message,wParam,lParam);
}
Then you need to make one more change. This code will not compile until you make the CExtResizablePropertySheet::m_bSheetInitialized
property protected
instead of private
.
To provide the color button with the classic look, create a CExtColorButton
-derived class and implement the CExtColorButton::_RenderImpl()
virtual method. Your method should paint the button using the classic Win32 API.