MessageBox

Overview

Creates and shows a message box. Manages message, header, predefined signs, and command buttons.

Signature

int MessageBox(string text, string caption = NULL, int flags = 0);

Parameters

  • text (string, [in]): The message to display.
  • caption (string, [in], optional): The header text. Defaults to the Expert Advisor's name if NULL or empty.
  • flags (int, [in], optional): Defines the set of buttons and appearance. Can be a combination of predefined flags (see [MessageBox Flags](/constants/io_constants/messbconstants#messageboxflags)). Defaults to 0.
  • Return Value

  • On success, returns one of the [MessageBox() return codes](/constants/io_constants/messbconstants).
  • Limitations

  • Cannot be called from custom indicators (due to interface thread execution).
  • Does not function within the [Strategy Tester](/runtime/testing#alert_etc).