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.

125 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. dtp.cpp
  5. Abstract:
  6. DateTimePicker common control MFC wrapper
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. //
  14. // Include Files
  15. //
  16. #include "stdafx.h"
  17. #include "comprop.h"
  18. #include "dtp.h"
  19. //
  20. // Static Initialization
  21. //
  22. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  23. BOOL CDateTimePicker::m_fClassRegistered = FALSE;
  24. /* static */
  25. BOOL
  26. CDateTimePicker::RegisterClass()
  27. /*++
  28. Routine Description:
  29. Ensure that the date-time class is registered.
  30. Arguments:
  31. None
  32. Return Value:
  33. TRUE for success, FALSE otherwise.
  34. --*/
  35. {
  36. if (!m_fClassRegistered)
  37. {
  38. //
  39. // Class not registed, register now
  40. //
  41. INITCOMMONCONTROLSEX icex;
  42. icex.dwSize = sizeof(icex);
  43. icex.dwICC = ICC_DATE_CLASSES;
  44. m_fClassRegistered = ::InitCommonControlsEx(&icex);
  45. }
  46. return m_fClassRegistered;
  47. }
  48. IMPLEMENT_DYNAMIC(CDateTimePicker, CWnd)
  49. CDateTimePicker::CDateTimePicker()
  50. /*++
  51. Routine Description:
  52. Constructor
  53. Arguments:
  54. None
  55. Return Value:
  56. N/A
  57. --*/
  58. {
  59. VERIFY(RegisterClass());
  60. }
  61. CDateTimePicker::~CDateTimePicker()
  62. /*++
  63. Routine Description:
  64. Destructor -- destroy the control
  65. Arguments:
  66. N/A
  67. Return Value:
  68. N/A
  69. --*/
  70. {
  71. DestroyWindow();
  72. }