home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cenvi23.zip / MSGBOXES.CMD < prev    next >
OS/2 REXX Batch file  |  1994-10-03  |  1KB  |  34 lines

  1. EXTPROC CEnvi2
  2. /*************************************************************
  3.  *** MsgBoxes - Sample Cmm code to demonstrate uses of the ***
  4.  *** ver.1      MessageBox() function.                     ***
  5.  *************************************************************/
  6. #include <MsgBox.lib>
  7.  
  8. MessageBox("The following samples show various ways\n"
  9.            "to use the Windows MessageBox() function.\n"
  10.            "A wrapper for MessageBox() is located in\n"
  11.            "the Cmm library: \"MsgBox.lib\"",
  12.            "MsgBoxes - Welcome!");
  13.  
  14. MessageBox("This example only passes 1 parameter: the message string.");
  15.  
  16. MessageBox("This passes the message string and a title.\nThis box is also moveable",
  17.            "Here is the title.",MB_MOVEABLE);
  18.  
  19. MessageBox("This example passes a zero-length string to get no title.","");
  20.  
  21. MessageBox("This box might appear after a nasty error.",NULL,MB_ERROR);
  22.  
  23. switch ( MessageBox("You can also offer different choices.\nPick one now...",
  24.                     "MessageBox() choices",
  25.                     MB_YESNOCANCEL) ) {
  26.    case MBID_YES:    button = "Yes";   break;
  27.    case MBID_NO:     button = "No";    break;
  28.    case MBID_CANCEL: button = "Cancel";   break;
  29. }
  30.  
  31. sprintf(message,"You selected the %s button",button);
  32. MessageBox(message,"");
  33.            
  34.