Board index » cppbuilder » Disable Form painting

Disable Form painting


2003-12-24 01:57:40 PM
cppbuilder43
I want to fully disable a Form for painting itself. The benefits of this issue reveals when you want to develop a graphical application (such as OpenGL) and the graphics library handles painting on its own.
Writing OnPaint event handler does not perform this task, because the form still paints itself at least with its background color in response to WM_PAINT message.
Regards,
 
 

Re:Disable Form painting

H.R. wrote:
Quote
I want to fully disable a Form for painting itself. The benefits of this issue reveals when you want to develop a graphical application (such as OpenGL) and the graphics library handles painting on its own.
Please do not multi-post and please wrap your lines manually.
Use messagemaps to catch the two or three messages.
class TForm1 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
void __fastcall HandlePAINT ( TMessage & Msg );
void __fastcall HandleNCPAINT ( TMessage & Msg );
void __fastcall HandleERASEBKGND ( TMessage & Msg );
public: // User declarations
__fastcall TForm1(TComponent* Owner);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER ( WM_PAINT, TMessage, HandlePAINT )
//MESSAGE_HANDLER ( WM_NCPAINT, TMessage, HandleNCPAINT )
MESSAGE_HANDLER ( WM_ERASEBKGND, TMessage, HandleERASEBKGND )
END_MESSAGE_MAP (TForm)
};
void __fastcall TForm1::HandlePAINT ( TMessage & Msg )
{
Msg.Result = true;
}
void __fastcall TForm1::HandleNCPAINT ( TMessage & Msg )
{
Msg.Result = true;
}
void __fastcall TForm1::HandleERASEBKGND ( TMessage & Msg )
{
Msg.Result = true;
}
Hans.