 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
H.R. Guest
|
Posted: Wed Dec 24, 2003 5:57 am Post subject: Disable Form painting |
|
|
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,
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Wed Dec 24, 2003 6:54 pm Post subject: 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.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|