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

  1. #pragma    title("Exception Example  --  Version 1.0  --  (Dialog2.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:   Dialog2.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. static INTERNALADDRESSLIST aial[ ] = { { (PFNINTADD)DialogueException2DlgProc, "DialogueException2DlgProc" },
  32.                        { NULL, NULL } };
  33.  
  34. INTERNALADDRESS    intaddDialog2 =     { __FILE__, 0,    aial };
  35.  
  36. #pragma    subtitle("   Dialogues - Dialogue Procedure")
  37. #pragma    page( )
  38.  
  39. /* --- DialogueException2DlgProc ----------------------- [ Public ] ---    */
  40. /*                                    */
  41. /*     This function is    used to    process    the messages for the dialog    */
  42. /*     procedure.                            */
  43. /*                                    */
  44. /*     Upon Entry:                            */
  45. /*                                    */
  46. /*     HWND   hWnd; = Dialog Window Handle                */
  47. /*     ULONG  msg;  = PM Message                    */
  48. /*     MPARAM mp1;  = Message Parameter    1                */
  49. /*     MPARAM mp2;  = Message Parameter    2                */
  50. /*                                    */
  51. /*     Upon Exit:                            */
  52. /*                                    */
  53. /*     DialogueException2DlgProc = Message Handling Result        */
  54. /*                                    */
  55. /* --------------------------------------------------------------------    */
  56.  
  57. MRESULT    EXPENTRY DialogueException2DlgProc(HWND    hWnd, ULONG msg, MPARAM    mp1, MPARAM mp2)
  58.  
  59. {
  60.  
  61. switch ( msg )
  62.    {
  63.             /* Perform dialog initialization        */
  64.    case    WM_INITDLG :
  65.     break;
  66.             /* Process control selections            */
  67.    case    WM_CONTROL :
  68.     switch ( SHORT2FROMMP(mp1) )
  69.         {
  70.         }
  71.     break;
  72.             /* Process push    button selections        */
  73.    case    WM_COMMAND :
  74.     switch ( SHORT1FROMMP(mp1) )
  75.         {
  76.         case DID_OK    :
  77.         WinDismissDlg(hWnd, TRUE);
  78.         break;
  79.         }
  80.     break;
  81.             /* Close requested, exit dialogue        */
  82.    case    WM_CLOSE :
  83.     WinDismissDlg(hWnd, FALSE);
  84.     break;
  85.  
  86.             /* Pass    through    unhandled messages        */
  87.    default :
  88.        return(WinDefDlgProc(hWnd, msg, mp1, mp2));
  89.    }
  90. return(0L);
  91. }
  92.