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
|
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = GetDC( hWnd );
HDC memDC = CreateCompatibleDC( hdc );
memDC = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
//get text
SelectObject (memDC, titleText);
SetBkMode (memDC, TRANSPARENT);
//title
TextOut( memDC, 20, 3, aTitle, _tcslen( aTitle ) );
//set up a buffer for the charCount
TCHAR buff[ 5 ];
//select smaller text
SelectObject (memDC, text);
//show copyright info
TextOut( memDC, 620, ( wHeight - 50 ), copyRight, _tcslen( copyRight ) );
//show chars left text
TextOut( memDC, 9, ( eHeight + 50 ), charsLeft, _tcslen( charsLeft ) );
TextOut( memDC, 100, ( eHeight + 50 ), buff, wsprintf( buff, L"%d", c.getCharCount() ) );
//draw to the window
BitBlt( hdc, 0, 0, 0, 0, memDC, 0, 0, SRCCOPY );
ReleaseDC( hWnd, hdc );
DeleteDC( memDC );
EndPaint(hWnd, &ps);
break;
}
|