Download MetaTrader 5


It creates and shows a message box and manages it. A message box contains a message and header, any combination of predefined signs and command buttons.

int  MessageBox(
   string  text,             // message text
   string  caption=NULL,     // box header
   int     flags=0           // defines set of buttons in the box



[in]  Text, containing message to output.


[in]  Optional text to be displayed in the box header. If the parameter is empty, Expert Advisor name is shown in the box header.


[in]  Optional flags defining appearance and behavior of a message box. Flags can be a combination of a special group of flags.

Return Value

If the function is successfully performed, the returned value is one of values of MessageBox() return codes.


The function is not recommended for use in custom indicators, as the call to the MessageBox() suspends the indicator's thread of execution for the whole time while waiting for the user's response. And since all indicators for each symbol are executed in a single thread, all charts of all timeframes for this symbol will be suspended.

MessageBox() function does not work in the Strategy Tester.