ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static BOOL ICONTITLE_Paint ( HWND  hwnd,
HWND  owner,
HDC  hDC,
BOOL  bActive 
) [static]

Definition at line 125 of file icontitle.c.

Referenced by IconTitleWndProc().

{
    RECT rect;
    HFONT hPrevFont;
    HBRUSH hBrush = 0;
    COLORREF textColor = 0;

    if( bActive )
    {
    hBrush = GetSysColorBrush(COLOR_ACTIVECAPTION);
    textColor = GetSysColor(COLOR_CAPTIONTEXT);
    }
    else
    {
        if( GetWindowLongPtrA( hwnd, GWL_STYLE ) & WS_CHILD )
    {
        hBrush = (HBRUSH) GetClassLongPtrW(hwnd, GCLP_HBRBACKGROUND);
        if( hBrush )
        {
        INT level;
        LOGBRUSH logBrush;
        GetObjectA( hBrush, sizeof(logBrush), &logBrush );
        level = GetRValue(logBrush.lbColor) +
               GetGValue(logBrush.lbColor) +
                  GetBValue(logBrush.lbColor);
        if( level < (0x7F * 3) )
            textColor = RGB( 0xFF, 0xFF, 0xFF );
        }
        else
        hBrush = GetStockObject( WHITE_BRUSH );
    }
    else
    {
        hBrush = GetStockObject( BLACK_BRUSH );
        textColor = RGB( 0xFF, 0xFF, 0xFF );
    }
    }

    GetClientRect( hwnd, &rect );
    DPtoLP( hDC, (LPPOINT)&rect, 2 );
    FillRect( hDC, &rect, hBrush );

    hPrevFont = SelectObject( hDC, hIconTitleFont );
    if( hPrevFont )
    {
    WCHAR buffer[80];

        INT length = GetWindowTextW( owner, buffer, sizeof(buffer)/sizeof(buffer[0]) );
        SetTextColor( hDC, textColor );
        SetBkMode( hDC, TRANSPARENT );

        DrawTextW( hDC, buffer, length, &rect, DT_CENTER | DT_NOPREFIX |
                   DT_WORDBREAK | ((bMultiLineTitle) ? 0 : DT_SINGLELINE) );

    SelectObject( hDC, hPrevFont );
    }
    return (hPrevFont != 0);
}

Generated on Sat May 26 2012 06:11:10 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.