HRESULT CDlgPage::OnInitDialog() { if(GetThemeLib().IsAvailable() && GetThemeLib().IsThemeActive()) GetThemeLib().EnableThemeDialogTexture(m_Hwnd, ETDT_ENABLETAB); return S_OK; }
void CPropPageFrameBordered::DrawBackground(CDC* pDC) { if (GetThemeLib().IsAvailable() && GetThemeLib().IsThemeActive() && GetThemeLib().IsAppThemed() ) { // Delegate to base class. CPropPageFrameEx::DrawBackground( pDC ); } else { // Draw our own background. CWnd::OnEraseBkgnd( pDC ); CRect rect; GetClientRect(rect); ::FillRect(pDC->m_hDC, &rect, ::GetSysColorBrush( COLOR_BTNFACE ) ); } }
BOOL CPropPageFrameBordered::Create(DWORD dwWindowStyle, const RECT &rect, CWnd *pwndParent, UINT nID) { if (GetThemeLib().IsAvailable() && GetThemeLib().IsThemeActive() && GetThemeLib().IsAppThemed() ) { // Delegate to base class. return CPropPageFrameEx::Create(dwWindowStyle, rect, pwndParent, nID); } else { return CWnd::CreateEx( WS_EX_CLIENTEDGE|WS_EX_TRANSPARENT, AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW, AfxGetApp()->LoadStandardCursor(IDC_ARROW), GetSysColorBrush(COLOR_3DFACE)), _T("PropPageFrameBordered"), dwWindowStyle, rect, pwndParent, nID); } }
CRect CPropPageFrameEx::CalcCaptionArea() { CRect rect; GetClientRect(rect); if (GetThemeLib().IsAvailable() && GetThemeLib().IsThemeActive() && GetThemeLib().IsAppThemed() ) { HTHEME hTheme = GetThemeLib().OpenThemeData(m_hWnd, L"Tab"); if (hTheme) { CRect rectContent; CDC *pDc = GetDC(); GetThemeLib().GetThemeBackgroundContentRect(hTheme, pDc->m_hDC, TABP_PANE, 0, rect, rectContent); ReleaseDC(pDc); GetThemeLib().CloseThemeData(hTheme); if (GetShowCaption()) rectContent.bottom = rect.top+GetCaptionHeight(); else rectContent.bottom = rectContent.top; rect = rectContent; } } else { if (GetShowCaption()) rect.bottom = rect.top+GetCaptionHeight(); else rect.bottom = rect.top; } return rect; }
void CPropPageFrameEx::DrawBackground(CDC* pDC) { if (GetThemeLib().IsAvailable() && GetThemeLib().IsThemeActive() && GetThemeLib().IsAppThemed() ) { HTHEME hTheme = GetThemeLib().OpenThemeData(m_hWnd, L"Tab"); if (hTheme) { CRect rect; GetClientRect(rect); GetThemeLib().DrawThemeBackground(hTheme, pDC->m_hDC, TABP_PANE, 0, rect, NULL); GetThemeLib().CloseThemeData(hTheme); } } else { CWnd::OnEraseBkgnd(pDC); CRect rect; GetClientRect(rect); ::FillRect(pDC->m_hDC, &rect, ::GetSysColorBrush( COLOR_BTNFACE ) ); } }