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 Tech Support » I am troubled with a problem of Dwm. (part2) Collapse All
Subject Author Date
tera tera Mar 31, 2009 - 8:57 PM

Hello.


The triangle mark is displayed definitely by a sample program

However,

caption text is not displayed.

Please teach a good method.



 


In the following commands, the text was displayed

However, black is displayed with transparence color.


CRect rcDraw, rcExclude;

GetWindowRect( &rcDraw );

GetClientRect( &rcExclude );

ClientToScreen( &rcExclude );

rcExclude.OffsetRect( -rcDraw.TopLeft() );

rcDraw.OffsetRect( -rcDraw.TopLeft() );



CWindowDC dcWindow( this );

dcWindow.ExcludeClipRect( &rcExclude );

CExtMemoryDC dc( &dcWindow, &rcDraw, CExtMemoryDC::MDCOPT_TO_MEMORY | CExtMemoryDC::MDCOPT_FORCE_DIB );

dc.FillSolidRect( &rcDraw, RGB(0,0,0) );





CDC * pCDC = &dc;



//------------------------------------------------

INT nOldBkMode = dc.SetBkMode( TRANSPARENT );

COLORREF clrOldText = dc.SetTextColor( RGB(55,55,55) );



CString csStr;

GetWindowText( csStr );

UINT nFormat =

DT_SINGLELINE

// |DT_VCENTER

// |DT_CENTER

|DT_LEFT

|DT_TOP

;



dc.DrawText(

csStr,

csStr.GetLength(),

rcDraw,

nFormat

);

dc.SetTextColor( clrOldText );

dc.SetBkMode ( nOldBkMode );


 

Technical Support Apr 2, 2009 - 5:16 AM

You should paint the window caption text with a glow effect. The DrawText() API cannot help you. You should use the DrawThemeTextEx() API which is a feature of Windows Vista only. Besides, you need additional tricks like memory DC with negative height to draw Vista text. Please take a look at the source code of the CExtPaintManagerOffice2007_Impl::Ribbon_NcOverPaint() for details.

tera tera Apr 3, 2009 - 2:44 AM

Hello.


I was able to display the title in Dmw.



 


However, White gradation is not displayed around a character.


I want you to teach a probable cause.


 


Thanks,


 

Technical Support Apr 3, 2009 - 10:55 AM

Here is how we painted the same text with a glow effect in the CExtPaintManagerOffice2007_Impl::Ribbon_NcOverPaint() method:

   static const int g_nDwmGlowSize2007 = 10;
            . . .
            CExtUxTheme::__EXT_UX_DTTOPTS dto = { sizeof(CExtUxTheme::__EXT_UX_DTTOPTS) };
            dto.dwFlags = __EXT_UX_DTT_TEXTCOLOR;
            dto.iGlowSize = g_nDwmGlowSize2007;
            if( pWnd->IsZoomed() )
            {
                        dto.crText = RGB(0x0FF,0x0FF,0x0FF);
            }
            else
            {
                        dto.dwFlags |= __EXT_UX_DTT_COMPOSITED | __EXT_UX_DTT_GLOWSIZE;
                        dto.crText = bFrameActive ? RGB(0,0,0) : RGB(0x060,0x060,0x060);
            }
            g_PaintManager.m_UxTheme.DrawThemeTextEx(
                        dc32.m_hDC,
                        0,
                        0,
                        strWindowText,
                        -1,
                        DT_SINGLELINE|DT_CENTER|DT_VCENTER|DT_NOPREFIX,
                        rcText,
                        &dto
                        );
            dc32.SelectObject( pOldFont );
            if( bRTL )
            {
                        dc.SetLayout( dwOldLayout1 );
                        dc32.SetLayout( dwOldLayout2 );
            } // if( bRTL )

The dto.iGlowSize = g_nDwmGlowSize2007; line of code specifies the size of glow in pixels.

tera tera Apr 7, 2009 - 12:51 AM

Hello


When the icon of the dialogue is unestablished, it is displayed.




I want to acquire this standard icon.

Please teach a good method.

Technical Support Apr 8, 2009 - 6:47 AM

You should assign a window icon or remove the WS_SYSMENU style.

Technical Support Apr 7, 2009 - 1:00 PM

We confirm this issue. Thank you. It happens on Vista only. We are working on it.