home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / common / msdev98 / template / atl / dialog.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-16  |  1.5 KB  |  64 lines

  1. // [!HeaderName] : Declaration of the [!ClassName]
  2. [!crlf]
  3.  
  4. [!if=(FileExists, "FALSE")]
  5. #ifndef __[!UpperShortName]_H_
  6. #define __[!UpperShortName]_H_
  7. [!crlf]
  8. #include "resource.h"       // main symbols
  9. #include <atlhost.h>
  10. [!else]
  11. [!AddIncludeFile(TargetFile, "resource.h")]
  12. [!AddIncludeFile(TargetFile, "<atlhost.h>")]
  13. [!endif]
  14. [!crlf]
  15. /////////////////////////////////////////////////////////////////////////////
  16. // [!ClassName]
  17.  
  18. class [!ClassName] : 
  19.     public CAxDialogImpl<[!ClassName]>
  20. {
  21. public:
  22.     [!ClassName]()
  23.     {
  24.     }
  25. [!crlf]
  26.     ~[!ClassName]()
  27.     {
  28.     }
  29. [!crlf]
  30.     enum { IDD = IDD_[!UpperShortName] };
  31. [!crlf]
  32. BEGIN_MSG_MAP([!ClassName])
  33.     MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  34.     COMMAND_ID_HANDLER(IDOK, OnOK)
  35.     COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
  36. END_MSG_MAP()
  37. // Handler prototypes:
  38. //  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  39. //  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  40. //  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  41. [!crlf]
  42.     LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  43.     {
  44.         return 1;  // Let the system set the focus
  45.     }
  46. [!crlf]
  47.     LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  48.     {
  49.         EndDialog(wID);
  50.         return 0;
  51.     }
  52. [!crlf]
  53.     LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  54.     {
  55.         EndDialog(wID);
  56.         return 0;
  57.     }
  58. };
  59.  
  60. [!crlf]
  61. [!if=(FileExists, "FALSE")]
  62. #endif //__[!UpperShortName]_H_
  63. [!endif]
  64.