{*******************************************************************************
*
* Hintergrundfarbe eines MDI-Formulars setzen ohne die Farbe der darauf
* liegenden Objekte wie TGroupBox oder TPageControl zu verändern.
*
* Setting the Background color of a MDI Form without changing the color
* of overlayed objects like TGroupBox or TPageControl.
*
******************************************************************************}
destructor TForm1.Destroy; begin DeleteObject(BkBrush); inherited; end;
procedure TForm1.ClientWndProc(var Message: TMessage); var DC: HDC;
BrushOld: HBRUSH; begin
with Message do
begin
case Msg of WM_ERASEBKGND: begin DC := TWMEraseBkGnd(Message).DC;
BrushOld := SelectObject(DC, BkBrush);
FillRect(DC, ClientRect, BkBrush);
SelectObject(DC, BrushOld);
Result := 1; end; else Result := CallWindowProc(FPrevClientProc, ClientHandle, Msg, wParam, lParam); end; end; end;