home *** CD-ROM | disk | FTP | other *** search
- LONG theResult = -1;
- switch(Message)
- {
- case WM_PALLETTECHANGED:
- {
- InvalidateRect(hWnd, NULL, TRUE);
- UpdateWindow(hWnd);
- theResult = 0L;
- break;
- }
- case WM_PAINT:
- {
- HBRUSH hBrush;
- HBRUSH hBrushOld;
- PAINTSTRUCT paint;
- HDC hDC = BeginPaint(hWnd, &paint);
- hBrush = CreateSolidBrush(BACKGROUND_COLOR);
- hBrushOld = (HPEN) SelectObject(hDC, hBrush);
- BOOL result = FillRect(hDC, &paint.rcPaint, hBrush);
- SelectObject(hDC, hBrushOld);
- DeleteObject(hBrush);
- EndPaint(hWnd, &paint);
- theResult = 0L;
- break;
- }
- default:
- {
- // this message was not for us; call old Window process
- // this code omitted for clarity
- break;
- }
- }
- return theResult;
-
-