The following code illustrates creating a modal window, similar to WinMessageBox, that can be used to display error messages and ask questions.
#define INCL_SW
#include <os2me.h>
SMBD Smbd[4] = {{ "~Save", ID_SAVE,BS_DEFAULT},
{ "~Discard", ID_DISCARD,0},
{ "Cancel", ID_CANCEL, 0},
{ "Help", ID_HELP, BS_HELP}};
SMBINFO SmbInfo;
ULONG Result;
SmbInfo.hIcon = NULL;
SmbInfo.cButtons = 4;
SmbInfo.hwndNotify = NULL;
SmbInfo.flStyle = MB_QUERY;
SmbInfo.psmbd = Smbd;
Result = WinSecondaryMessageBox (HWND_DESKTOP,
HWND_DESKTOP,
"Changes have not been saved.",
"Title",
ID_SAVEPROMPT,
&SmbInfo);