Source code of Windows XP (NT5)
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.

128 lines
3.3 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. /*******************************************************************************
  3. *
  4. * basedlg.cpp
  5. *
  6. * implementation of CBaseDialog class
  7. * This class handles some extra housekeeping functions for WinUtils dialogs.
  8. *
  9. * copyright notice: Copyright 1995, Citrix Systems Inc.
  10. *
  11. * $Author: butchd $ Butch Davis
  12. *
  13. * $Log: N:\NT\PRIVATE\UTILS\CITRIX\WINUTILS\COMMON\VCS\BASEDLG.CPP $
  14. *
  15. * Rev 1.1 29 Dec 1995 17:19:08 butchd
  16. * update
  17. *
  18. *******************************************************************************/
  19. /*
  20. * include files
  21. */
  22. #include <stdafx.h>
  23. #include <afxwin.h> // MFC core and standard components
  24. #include <afxext.h> // MFC extensions
  25. #include "common.h"
  26. #include "basedlg.h"
  27. #ifdef _DEBUG
  28. #undef THIS_FILE
  29. static char BASED_CODE THIS_FILE[] = __FILE__;
  30. #endif
  31. extern "C" HWND WinUtilsAppWindow;
  32. ///////////////////////////////////////////////////////////////////////////////
  33. // CBaseDialog class construction / destruction, implementation
  34. IMPLEMENT_DYNAMIC(CBaseDialog, CDialog)
  35. /*******************************************************************************
  36. *
  37. * CBaseDialog - CBaseDialog constructor
  38. *
  39. * ENTRY:
  40. * idResource (input)
  41. * Resource Id of dialog template.
  42. * pParentWnd (input/optional)
  43. * CWnd * to parent of dialog (NULL is default)
  44. * EXIT:
  45. * (Refer to MFC CDialog::CDialog documentation)
  46. *
  47. ******************************************************************************/
  48. CBaseDialog::CBaseDialog( UINT idResource, CWnd *pParentWnd )
  49. :CDialog(idResource, pParentWnd),
  50. m_bError(FALSE)
  51. {
  52. } // end CBaseDialog::CBaseDialog
  53. ////////////////////////////////////////////////////////////////////////////////
  54. // CBaseDialog operations
  55. ////////////////////////////////////////////////////////////////////////////////
  56. // CBaseDialog message map
  57. BEGIN_MESSAGE_MAP(CBaseDialog, CDialog)
  58. //{{AFX_MSG_MAP(CBaseDialog)
  59. ON_WM_CREATE()
  60. ON_WM_DESTROY()
  61. //}}AFX_MSG_MAP
  62. END_MESSAGE_MAP()
  63. /////////////////////////////////////////////////////////////////////////////
  64. // CBaseDialog commands
  65. /*******************************************************************************
  66. *
  67. * OnCreate - CBaseDialog member function: command (override)
  68. *
  69. * Save & set global window handle for messages.
  70. *
  71. * ENTRY:
  72. * EXIT:
  73. *
  74. ******************************************************************************/
  75. int
  76. CBaseDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
  77. {
  78. if (CDialog::OnCreate(lpCreateStruct) == -1)
  79. return -1;
  80. /*
  81. * Set global window handle for messages.
  82. */
  83. m_SaveWinUtilsAppWindow = WinUtilsAppWindow;
  84. WinUtilsAppWindow = GetSafeHwnd();
  85. return 0;
  86. } // end CBaseDialog::OnCreate
  87. /*******************************************************************************
  88. *
  89. * OnDestroy - CBaseDialog member function: command (override)
  90. *
  91. * Restore global window handle (for messages) to previous setting.
  92. *
  93. * ENTRY:
  94. * EXIT:
  95. *
  96. ******************************************************************************/
  97. void
  98. CBaseDialog::OnDestroy()
  99. {
  100. CDialog::OnDestroy();
  101. WinUtilsAppWindow = m_SaveWinUtilsAppWindow;
  102. } // end CBaseDialog::OnDestroy
  103. ////////////////////////////////////////////////////////////////////////////////