Skip to content

Messages

Gratt-5r2 edited this page Apr 9, 2022 · 2 revisions

class Message and MessageW

static int Box(HWND hwnd, const CStringA& msg, const CStringA& title, UINT uType)

Equal the winapi MessageBox.
Returns the winapi MessageBox result.

Static methods

void Box(string msg, string title = "Union", bool_t TopMost = False)

Shows a default MessageBox.

void Info(string msg, string title = "Union Info", bool_t TopMost = False)

Shows a MessageBox with the info icon.

void Error(string msg, string title = "Union Error", bool_t TopMost = True )

Shows a MessageBox with the error icon.

void Warning(string msg, string title = "Union Warning", bool_t TopMost = True )

Shows a MessageBox with the warning icon.

bool_t Choice(string msg, string title = "Union Choice", bool_t TopMost = False)

Shows a MessageBox with the question icon and ok|cancel buttons.
Returns true (if ok) and false (if cancel).

bool_t Question(string msg, string title = "Union Question", bool_t TopMost = False)

Shows a MessageBox with the question icon and yes|no buttons.
Returns true (if yes) and false (if no).

bool_t Retry(string msg, string title = "Union Retry", bool_t TopMost = False)

Shows a MessageBox with the warning icon and retry|cancel buttons.
Returns true (if retry) and false (if cancel).

void Fatal(string msg, string title = "Union Fatal", bool_t TopMost = True )

Shows a MessageBox with the error icon.
Terminates the program.

Arguments

msg - is the message of window.
title - is a texts in the header of the message window.
TopMost - argument allows to create a window on top of others.

Example

bool_t result = Message::Question("Exit from the game?")
if( result == True )
  exit(0);
Clone this wiki locally