BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Disable Form painting

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
H.R.
Guest





PostPosted: Wed Dec 24, 2003 5:57 am    Post subject: Disable Form painting Reply with 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.

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





PostPosted: Wed Dec 24, 2003 6:54 pm    Post subject: Re: Disable Form painting Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.