Detect a click on the caption of a form
The following example will capture a click with the left
button on the caption of the form . Put this declaration in the private of the
form :
Procedure
WMNCLBUTTONDOWN ( Var Message : TMessage ) ;
Message WM_NCLBUTTONDOWN ;
And the procedure in the implementation :
Procedure
TForm1.WMNCLBUTTONDOWN ( Var Message : TMessage ) ;
Begin
If Message.wParam = HTCAPTION
Then Caption := 'CLICK' ;
Message.Result := 0 ;
End ;