home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / asci20b1.zip / about.c next >
Text File  |  1999-05-21  |  1KB  |  44 lines

  1. /* about.c: The About module */
  2.  
  3. // Window procedure for the about dialogbox
  4. // Is called by the system
  5. MRESULT EXPENTRY AboutProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
  6. {
  7. // Declaration of variables
  8. USHORT ControlID;
  9. switch (msg)
  10.    {
  11.    case WM_INITDLG:
  12.       // Initialization
  13.       // Nothing
  14.       break;
  15.    case WM_COMMAND:
  16.       // Commands from controls
  17.       // Resource ID of control
  18.       ControlID=SHORT1FROMMP(mp1);
  19.       switch (ControlID)
  20.          {
  21.          case PB_OK:
  22.             // Pushbutton pressed
  23.             // Close the About dialogbox
  24.             // Send the WM_CLOSE message
  25.             WinSendMsg(hwnd, WM_CLOSE, 0L, 0L);
  26.             break;
  27.          }
  28.       break;
  29.    case WM_CLOSE:
  30.       // Close the About dialogbox
  31.       // User pressed the Ok button
  32.       // Dismiss the dialogbox
  33.       WinDismissDlg(hwnd, TRUE);
  34.       // Note we now do not send a WM_QUIT message, if we did so, we would close all of the application
  35.       break;
  36.    default:
  37.       // Let the default window procedure handle messages we didn't handle
  38.       return WinDefDlgProc(hwnd, msg, mp1, mp2);
  39.    }
  40. // All messages are handled
  41. return (MRESULT)FALSE;
  42. }
  43.  
  44.