Click X in Dialog box

 
How can I tell if the user has clicked on the 'X' icon button in the Dialog Box Title bar ??
 

There are many X ses.

X to close splash dialog.

X to close the terminal.

X to close the chart.

X to close marketwatch.

X to close the navigator.

X to close datawindow.

X to close strategy tester.

X to close application dialog.

X to close messagebox.

X to close alert dialog.

And they all have a title bar too.

Why didn't you specify what exact window you mean ? 

Assuming you mean a custom made dialog then:

If you know the object name you can check for it's state by ObjectGetInteger() and OBJPROP_STATE.

But since the dialog will disappear when they click the X you can simply check for the existence of the dialog itself by ObjectFind() function.

If it doesn't find the window it must have been closed.

And you can launch another event in chart event function. 

And if you mean something else maybe you can use chart functions see Here.

Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Chart Properties
Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Chart Properties
  • www.mql5.com
Price chart drawing. If false, drawing any price chart attributes is disabled and all chart border indents are eliminated, including time and price scales, quick navigation bar, Calendar event labels, trade labels, indicator and bar tooltips, indicator subwindows, volume histograms, etc. Scrolling the chart horizontally using the left mouse...
Reason: