Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DoubleClick on TitleBar

11 views
Skip to first unread message

Andreas

unread,
Sep 28, 2001, 8:10:10 AM9/28/01
to

Hello.

I need to capture every double click on the title bar of a TForm. How can I do this?

Many thanks for every hint in advance,
Andreas

Ronnie

unread,
Sep 28, 2001, 10:50:42 AM9/28/01
to
Andreas,

Use the TForm::OnCanResize event:

void __fastcall TForm1::FormCanResize(TObject *Sender, int &NewWidth,
int &NewHeight, bool &Resize)

Check the NewWidth and NewHeight parameters to see if the event is triggered
by an attempt to maximize or normalize the form.

HTH,
Ronnie

"Andreas" <nacht...@web.de> schreef in bericht news:3bb468a2$1_2@dnews...

Remy Lebeau

unread,
Sep 28, 2001, 12:18:09 PM9/28/01
to
Use a MESSAGE_MAP to catch the WM_NCLBUTTONDBLCLK message:

class TMyForm : public TForm
{
typedef TForm inherited;
private:
void __fastcall WMNCLButtonDblClk(TMessage &Message);
public:
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_NCLBUTTONDBLCLK, TMessage, WMNCLButtonDblClk)
END_MESSAGE_MAP(TForm)
};

void __fastcall TMyForm::WMNCLButtonDblClk(TMessage &Message)
{
if (Message.WParam == HTCAPTION)
{
// do something
Message.Result = 0;
}
else
inherited::Dispatch(&Message);
}


Gambit

"Andreas" <nacht...@web.de> wrote in message news:3bb468a2$1_2@dnews...

Andreas

unread,
Oct 1, 2001, 5:29:35 AM10/1/01
to
0 new messages