home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / numega / sc501.exe / data1.cab / Examples / ABOUTBOX.CPP next >
Encoding:
C/C++ Source or Header  |  1997-11-25  |  2.4 KB  |  90 lines

  1. /*
  2.  * AboutBox.cpp
  3.  * $Header: /BoundsChecker/Examples/BUGBNCHX/ABOUTBOX.CPP 2     12/13/96 2:20p Stevea $
  4.  *
  5.  * Description:
  6.  *  The AboutBox WindProx and message handler implementations.
  7.  *
  8.  * Notes:
  9.  *  <implementation notes go here>
  10.  *
  11.  ***********************************************************************
  12.  *
  13.  * Nu-Mega Technologies, Inc.
  14.  * P.O. Box 7780
  15.  * Nashua, NH 03060
  16.  *
  17.  * (c) Copyright 1994, 1995 Nu-Mega Technologies, Inc.
  18.  * ALL RIGHTS RESERVED.
  19.  *
  20.  ***********************************************************************
  21.  *
  22.  **********************************************************************/
  23. #include "stdafx.h"
  24. #include "BugBench.h"
  25. #include "AboutBox.h"
  26.  
  27. ////////////////////////////////////////////////////////////////////////
  28. // AboutBox message handlers
  29.  
  30. BOOL AboutBox_OnInitDialog ( HWND hwndAbout , HWND hwndFocus , LPARAM lParam )
  31. {
  32.    ::CenterWindow ( hwndAbout ) ;
  33.  
  34.    return ( TRUE ) ;
  35. }
  36.  
  37. ///////////////////////////////////////////////////////////
  38. // Handles WM_COMMAND messages for the AboutBox dialog.
  39. void AboutBox_OnCommand ( HWND  hWnd         ,
  40.                           int   idCmd        ,
  41.                           HWND  hWndCtl      ,
  42.                           UINT  uiCodeNotify  )
  43. {
  44.    switch ( idCmd )
  45.    {
  46.       case IDOK        :
  47.       case IDCANCEL    :
  48.          EndDialog ( hWnd , 0 ) ;
  49.          break ;
  50.    }
  51. }
  52.  
  53. // Handle the close from the AboutBox sys menu.
  54. void AboutBox_OnSysCommand ( HWND  hWnd         ,
  55.                              UINT  idCmd        ,
  56.                              int   xPos         ,
  57.                              int   yPos          )
  58. {
  59.    if ( SC_CLOSE == idCmd )
  60.    {
  61.       EndDialog ( hWnd , 0 ) ;
  62.    }
  63. }
  64.  
  65.  
  66.  
  67. ////////////////////////////////////////////////////////////////////////
  68. // AboutBox main message pump 
  69. BOOL CALLBACK AboutBox_DlgProc ( HWND    hDlg   ,
  70.                                  UINT    uMsg   ,
  71.                                  WPARAM  wParam ,
  72.                                  LPARAM  lParam  )
  73. {
  74.    BOOL fProcessed = TRUE;
  75.  
  76.    switch ( uMsg )
  77.    {
  78.       HANDLE_MSG ( hDlg , WM_INITDIALOG , AboutBox_OnInitDialog ) ;
  79.       HANDLE_MSG ( hDlg , WM_COMMAND    , AboutBox_OnCommand    ) ;
  80.       HANDLE_MSG ( hDlg , WM_SYSCOMMAND , AboutBox_OnSysCommand ) ;
  81.       default  :
  82.          fProcessed = FALSE ;
  83.          break ;
  84.    }
  85.    return ( fProcessed ) ;
  86. }
  87.  
  88.  
  89.  
  90.