1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
case WM_NCPAINT:
{
if( cw->GetFather() != NULL )
{
HDC hDC;
PAINTSTRUCT ps;
RECT r;
GetWindowRect(inHwnd, &r);
int width = r.right - r.left+1;
int height = r.bottom - r.top+1;
COLORREF c;
if( cw->GetHwnd() == ::GetFocus() )
{
c = RGB(255, 0, 0);
}
else
{
c = RGB(120, 120, 120);
}
hDC = ::GetWindowDC( inHwnd );
HBRUSH hbrush;
hbrush = CreateSolidBrush( c );
HPEN pen = CreatePen( PS_NULL, 0, c );
SelectObject(hDC, hbrush);
SelectObject(hDC, pen);
// int xb = GetSystemMetrics(SM_CXSIZEFRAME);
// int yb = GetSystemMetrics(SM_CYSIZEFRAME);
const int border = 8;
Rectangle( hDC, 0, 0, width, border );
Rectangle( hDC, width-border, 0, width, height );
Rectangle( hDC, 0, height-border, width, height );
Rectangle( hDC, 0, 0, border, height );
DeleteObject(hbrush);
DeleteObject(pen);
ReleaseDC( inHwnd, hDC );
return 0L;
}
} |
Partager