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 General Discussion » CExtResizablePropertyPage Collapse All
Subject Author Date
liu shu Sep 16, 2005 - 8:11 AM

How to draw something such as rect on a CExtResizablePropertyPage which cannot use OnPaint method.


Thank you!!1

liu shu Sep 16, 2005 - 9:03 AM

Thank you!!!!!


 

Technical Support Sep 16, 2005 - 8:39 AM

You can easily handle the WM_PAINT standard windows message in the WindowProc() virtual method of your CExtResizablePropertyPage-derived class:

LRESULT CYourPropertyPage::WindowProc(
    UINT message, WPARAM wParam, LPARAM lParam )
{
    if( message == WM_PAINT )
    {
        CRect rcClient;
        GetClientRect( &rcClient );
        CPaintDC dcPaint( this );
        CExtMemoryDC dc( &dcPaint, &rcClient );
        bool bTransparent = false;
        if( g_PaintManager->GetCb2DbTransparentMode( this ) )
        {
            CExtPaintManager::stat_ExcludeChildAreas(
                dc,
                GetSafeHwnd(),
                CExtPaintManager::
                    stat_DefExcludeChildAreaCallback
                );
            if( g_PaintManager->PaintDockerBkgnd( true, dc, this ) )
                bTransparent = true;
        } // if( g_PaintManager->GetCb2DbTransparentMode( this ) )
        if( ! bTransparent )
            dc.FillSolidRect(
                &rcClient,
                g_PaintManager->GetColor(
                    CExtPaintManager::CLR_3DFACE_OUT,
                    this
                    ) 
                );
        ///////////////////////////////////////////////////
        //////// DRAW YOUR RECTANGLES ON dc HERE ////////
        ///////////////////////////////////////////////////
        return 0;
    } // if( message == WM_PAINT ) 
    return
        CExtResizablePropertyPage::
            WindowProc( message, wParam, lParam );
}