typedef void __fastcall (__closure *TCloseQueryEvent)(System::TObject* Sender, bool &CanClose);
TCloseQueryEvent is used for event handlers that are called when a window is about to close.
The TCloseQueryEvent type is the type for event handlers that allow an application to block the closing of a window.
Sender is the object whose event handler is called. This is the form that is about to close or the dialog whose window is about to close.
CanClose is set by the event handler to indicate whether the form or dialog can close (True) or whether the user should be blocked from closing it (False).