An example is:
MessageBox (NULL, TEXT ("Hello, Windows 98!"), TEXT ("Somewindowname"), 0) ;
MB_ Prefixed Constants List
The 4th argument can actually be a combination of MB_ prefixed constants.
If my line is: MessageBox (NULL, TEXT ("Hello, Windows 98!"), TEXT ("Somewindowname"), 0) ;
the 4th argument is a value of 0, this is equivalent to MB_OK. it will have an OK box. Additionally, since its 0, it will have MB_DEFBUTTON1 meaning the first button is the main button,
If I had 2 buttons like:
MessageBox (NULL, TEXT ("Hello, Windows 98!"), TEXT ("Somewindowname"), MB_OK | MB_CANCEL) ;
“
The Ok button would be the main button and have focus since its button 0.
I would also have 2 buttons as I gave it 2 constants
Return
The message box returns an int type. This int type is the response of the message box (which button they pressed).
IDOK
is the value 1, which is the value returned when the user pressed on the OK button.
Messagebox can also return:
IDYES
, IDNO
, IDCANCEL
, IDABORT
, IDRETRY
, or IDIGNORE
with each of them having their respective int value representation.