Board index » cppbuilder » Disable Form painting
H.R.
![]() CBuilder Developer |
H.R.
![]() CBuilder Developer |
Disable Form painting2003-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, |
Hans Galema
![]() CBuilder Developer |
2003-12-25 02:54:44 AM
Re:Disable Form painting
H.R. wrote:
QuoteI 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. 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. |