怎样在MDI的客户区画背景
我使用了自定义消息
private:
void __fastcall OnDrawClient(TMessage &Message);
Graphics::TBitmap *bmp; // User declarations
public: // User declarations
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_ERASEBKGND,TMessage,OnDrawClient)
END_MESSAGE_MAP(TForm)
、、--------------
void __fastcall TForm1::OnDrawClient(TMessage &Message)
{
if(Form1->ClientHandle==(HWND)Message.WParam)
{
BitBlt(Form1->ClientHandle,0,0,bmp->Width,bmp->Height,bmp->Handle,0,0,SRCCOPY);
}
TForm::Dispatch(&Message);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
bmp=new Graphics::TBitmap();
bmp->LoadFromFile("C:\\AboutLogo.bmp");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
TRect rect;
rect=Form1->GetClientRect();
//GetClientRect(Form1->ClientHandle,rect);
InvalidateRect( Form1->ClientHandle,&rect,true);
}
向各位高手咨询