Message Boxes

Communication between a window or dialog procedure and a message box is relatively simple. The message box is created and processed using the WinMessageBox() function, and the only input data provided to this function is the title of the message box and the text of the message to be displayed. The application may affect the style of the message box, by specifying style attributes in the function call, as described in the IBM OS/2 Version 2.0 Presentation Manager Reference.

An example of the WinMessageBox() function is given in Figure "WinMessageBox() Function".

The result of the user's interaction with the message box (that is, the identifier of the button that was pressed) is communicated to the application in the form of an unsigned integer returned by the WinMessageBox() call. The application may then interrogate this returned value to determine the subsequent action to be taken.


[Back: Control Windows]
[Next: Identifying the Destination Window]