Professional UI Solutions
Site Map   /  Register


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 » Custom drawn stuff not appearing in dialogs Collapse All
Subject Author Date
Robert Webb Dec 7, 2008 - 4:20 PM


We have a bunch of dialogs that draw custom stuff in OnPaint(), but now with ProfUIS, much of it doesn’t appear.

Some of this is because Prof-UIS has filled group boxes, instead of empty (why is this?  Shouldn’t the skinned background come from the dialog itself?).  How do I ensure OnPaint() stuff is drawn after other controls?

But there’s also other stuff that isn’t showing up, even though those dialogs have no group boxes.  Any ideas?



Robert Webb Dec 11, 2008 - 12:29 AM

So is this the simplest/recommended way even for drawing stuff in the foreground?  I don’t need what I draw to show through other transparent controls for the most part.  I just need a way to draw stuff that won’t overlap other controls.


Technical Support Dec 11, 2008 - 10:48 AM

If you don’t need to draw compound inherited background, then you should simply handle the WM_PAINT message in the WindowProc() virtual method:

virtual LRESULT WindowProc( UINT message, WPARAM wParam, LPARAM lParam ) 
            if( message == WM_PAINT )
                        CRect rcClient;
                        GetClientRect( &rcClient );
                        CPaintDC dcPaint( this );
                        CExtPaintManager::stat_ExcludeChildAreas( dcPaint, m_hWnd, CExtPaintManager::stat_DefExcludeChildAreaCallback );
                        CExtMemoryDC dc( &dcPaint, &rcClient );
                        // First of all we will paint default themed background.
                        if( ! ( g_PaintManager->GetCb2DbTransparentMode(this) && g_PaintManager->PaintDockerBkgnd( true, dc, this ) ) )
                                    dc.FillSolidRect( &rcClient, g_PaintManager->GetColor( COLOR_3DFACE ) );      
                        // TO-DO: Paint custom background here.
                        g_PaintManager->OnPaintSessionComplete( this );
                        return 0L;
            return __BASE_CLASS__ :: WindowProc( message, wParam, lParam );

Technical Support Dec 9, 2008 - 9:59 AM

The CExtResizableDialog class is wrapped with the CExtWS template. A WM_PAINT message is handled in CExtWS::WindowProc() . A CExtResizableDialog-derived dialog requires the WS_CLIPCHILDREN|WS_CLIPSIBLIBGS window styles. So, you cannot handle WM_PAINT messages for painting the background of both the dialog window and its controls. Please read about how to paint a custom background in any window (including dialogs) using a shared custom background here: