home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / except1.zip / Dialog1.C < prev    next >
C/C++ Source or Header  |  1994-08-23  |  3KB  |  95 lines

  1. #pragma    title("Exception Example  --  Version 1.0  --  (Dialog1.C)")
  2. #pragma    subtitle("   Module Purpose - Interface Definitions")
  3.  
  4. #define    INCL_WIN           /* Include OS/2 PM Windows Interface    */
  5.  
  6. #pragma    info(noext)
  7.  
  8. #include <os2.h>
  9.  
  10. #include "appdefs.h"
  11. #include "except.h"
  12.  
  13. /* This    module contains    routine    used to    handle a dialogue procedure.    */
  14.  
  15. /* Filename:   Dialog1.C                        */
  16.  
  17. /*  Version:   1.0                            */
  18. /*  Created:   1994-08-23                        */
  19. /*  Revised:   1994-08-23                        */
  20.  
  21. /* Routines:   MRESULT EXPENTRY    DialogueException1DlgProc(HWND hWnd,    */
  22. /*                              ULONG    msg,    */
  23. /*                              MPARAM mp1,    */
  24. /*                              MPARAM mp2);    */
  25.  
  26.  
  27. /* Copyright ╕ 1994, 1995  Prominare Inc.  All Rights Reserved.        */
  28.  
  29. /* --------------------------------------------------------------------    */
  30.  
  31. PINT pi;               /* Pointer                */
  32.  
  33. static INTERNALADDRESSLIST aial[ ] = { { (PFNINTADD)DialogueException1DlgProc, "DialogueException1DlgProc" },
  34.                        { NULL, NULL } };
  35.  
  36. INTERNALADDRESS    intaddDialog1 =     { __FILE__, 0,    aial };
  37.  
  38. #pragma    subtitle("   Dialogues - Dialogue Procedure")
  39. #pragma    page( )
  40.  
  41. /* --- DialogueException1DlgProc ----------------------- [ Public ] ---    */
  42. /*                                    */
  43. /*     This function is    used to    process    the messages for the dialog    */
  44. /*     procedure.                            */
  45. /*                                    */
  46. /*     Upon Entry:                            */
  47. /*                                    */
  48. /*     HWND   hWnd; = Dialog Window Handle                */
  49. /*     ULONG  msg;  = PM Message                    */
  50. /*     MPARAM mp1;  = Message Parameter    1                */
  51. /*     MPARAM mp2;  = Message Parameter    2                */
  52. /*                                    */
  53. /*     Upon Exit:                            */
  54. /*                                    */
  55. /*     DialogueException1DlgProc = Message Handling Result        */
  56. /*                                    */
  57. /* --------------------------------------------------------------------    */
  58.  
  59. MRESULT    EXPENTRY DialogueException1DlgProc(HWND    hWnd, ULONG msg, MPARAM    mp1, MPARAM mp2)
  60.  
  61. {
  62.  
  63. switch ( msg )
  64.    {
  65.             /* Perform dialog initialization        */
  66.    case    WM_INITDLG :
  67.        break;
  68.             /* Process control selections            */
  69.    case    WM_CONTROL :
  70.        switch (    SHORT2FROMMP(mp1) )
  71.        {
  72.        }
  73.        break;
  74.             /* Process push    button selections        */
  75.    case    WM_COMMAND :
  76.        switch (    SHORT1FROMMP(mp1) )
  77.        {
  78.        case    DID_OK :
  79.            *pi = 0;
  80.            WinDismissDlg(hWnd, TRUE);
  81.            break;
  82.        }
  83.        break;
  84.             /* Close requested, exit dialogue        */
  85.    case    WM_CLOSE :
  86.        WinDismissDlg(hWnd, FALSE);
  87.        break;
  88.  
  89.             /* Pass    through    unhandled messages        */
  90.    default :
  91.        return(WinDefDlgProc(hWnd, msg, mp1, mp2));
  92.    }
  93. return(0L);
  94. }
  95.