Hi,
HAs anyone an example how to handle to act on the WM_PAINT message
Greetings,
Bart Huls
> Hi,
> I want to catch this message because I want must do someting when the
> form is being maximized, Or is there an other way?
> Thanks,
> Bart Huls
In the class header for your form put the following code:-
class TMyForm : public TForm
{
...
private: // User declarations
void __fastcall MyPaint(TMessage* Message);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_PAINT, TMessage*, MyPaint)
END_MESSAGE_MAP(TForm)
...
Then in the form module, write the necessary code that you need to do:-Quote:};
void __fastcall TMyForm::MyPaint(TMessage *Message)
{
...
Now the bad news ! Remember that by depriving the form of it's regularQuote:}
Perhaps trapping the WM_SIZE message would be more fruitful. You'll have
to check the wParam part of the message (Message->wParam) to see if the
form has Maximized (wParam==2), Minimized (wParam==1) or Restored
(wParam==0)
Page 8-4 in the BCB 1.0 Component Writer's Guide gives more details.
Good luck !
When a form is maxed your resize handler will be called, and you canQuote:>I want to catch this message because I want must do someting when the
>form is being maximized, Or is there an other way?
I tried to use the WM_SIZE message but when I catch the message it
seems that the corrupts the getting of the WM_GETMINMAX message.
Maybe I'm doing something wrong, but I don't have enough documentation
about this. can you tell me what the Message parameters are?
Thanks,
Bart Huls
How did you trap WM_PAINT? With a message map, or by overriding the WndProcQuote:>Calling TForm::Dispatch(&Message) results in a Stackoverflow
If your base class is not TForm, make sure that you replace TForm with the
correct base class.
Harold Howe (TeamB)
http://www.bcbdev.com
I'm catching the WM_SIZE command in the message mapQuote:> >Calling TForm::Dispatch(&Message) results in a Stackoverflow
> How did you trap WM_PAINT? With a message map, or by overriding the WndProc
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_SIZE ,TWMSize ,WMSize );
END_MESSAGE_MAP(TForm)
And in the source:Quote:};
void __fastcall TfrmRadarPresentatie::WMSize(TWMSize &Message)
{
TfrmRadarPresentatie::Dispatch(&Message);
It creates a stack-overflow. When I'm not calling the default-handlerQuote:}
Regards,
Bart Huls
> It creates a stack-overflow. When I'm not calling the default-handler
> there is a scrollbar on my form.
1. Swapbuffers() without WM_PAINT msg
Hi,
I'm delopping an OpenGL wrapper for Tcl / Tk
(http://sourceforge.net/projects/om2t) that works fine under Linux but
still
have some problems under Windows. The main one is that I can't swap
buffers
of a double-buffered window if a WM_PAINT message hasn't been
triggered
before. As a simplified example, this function... :
void repaint() {
DoPaintingStuff();
SwapBuffers();
}
...works when called by the WM_PAINT handler but has no effect on
screen when called anywhere else. Note that I have no problem when
flushing
simple-buffered windows. The temporary solution I've adopted is
something like that... :
void
tempNote also that I've tried to call
Any Idea?
Thanx.
2. u ::[OT]my online portfolio|visual
5. too many WM_PAINTs freeze my interface
8. Handling X Expose / WM_PAINT events
10. Paint event -vs- WM_PAINT message
11. Subclassing WM_PAINT is not working, help!