Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: dlgbase.hxx
  7. //
  8. // Contents: CDialog base class
  9. //
  10. // History: 19-Oct-94 BruceFo Created.
  11. //
  12. //--------------------------------------------------------------------------
  13. #ifndef __DLGBASE_HXX__
  14. #define __DLGBASE_HXX__
  15. class CDialog
  16. {
  17. public:
  18. //
  19. // constructor, destructor
  20. //
  21. CDialog(
  22. IN HWND hwndParent,
  23. IN LPWSTR lpszTemplate
  24. )
  25. :
  26. _hwndParent(hwndParent),
  27. _lpszTemplate(lpszTemplate)
  28. {
  29. }
  30. virtual ~CDialog() { }
  31. INT_PTR
  32. DoModal(
  33. VOID
  34. )
  35. {
  36. return DialogBoxParam(
  37. g_hInstance,
  38. _lpszTemplate,
  39. _hwndParent,
  40. _WinDlgProc,
  41. (LPARAM) this);
  42. }
  43. virtual
  44. INT_PTR
  45. DlgProc(
  46. IN HWND hwnd,
  47. IN UINT msg,
  48. IN WPARAM wParam,
  49. IN LPARAM lParam
  50. ) = 0;
  51. private:
  52. //
  53. // Dialog procedures
  54. //
  55. static
  56. INT_PTR CALLBACK
  57. _WinDlgProc(
  58. IN HWND hwnd,
  59. IN UINT msg,
  60. IN WPARAM wParam,
  61. IN LPARAM lParam
  62. );
  63. //
  64. // Class variables
  65. //
  66. HWND _hwndParent;
  67. LPTSTR _lpszTemplate;
  68. };
  69. #endif // __DLGBASE_HXX__