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.

152 lines
4.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1998 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // AtlDbgWin.cpp
  7. //
  8. // Description:
  9. // Definitions for debugging windowing classes.
  10. //
  11. // Author:
  12. // David Potter (davidp) February 10, 1998
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #ifndef __ATLDBGWIN_H_
  20. #define __ATLDBGWIN_H_
  21. /////////////////////////////////////////////////////////////////////////////
  22. // Forward Class Declarations
  23. /////////////////////////////////////////////////////////////////////////////
  24. /////////////////////////////////////////////////////////////////////////////
  25. // External Class Declarations
  26. /////////////////////////////////////////////////////////////////////////////
  27. /////////////////////////////////////////////////////////////////////////////
  28. // Include Files
  29. /////////////////////////////////////////////////////////////////////////////
  30. /////////////////////////////////////////////////////////////////////////////
  31. // Type Definitions
  32. /////////////////////////////////////////////////////////////////////////////
  33. #if DBG
  34. struct ID_MAP_ENTRY
  35. {
  36. UINT id; // control ID
  37. LPCTSTR pszName; // control name
  38. }; //*** struct ID_MAP_ENTRY
  39. #endif // DBG
  40. #if DBG && ( defined( _DBG_MSG_NOTIFY ) || defined( _DBG_MSG_COMMAND ) || defined( _DBG_MSG ) )
  41. // Define the class name for use without a control name map.
  42. #define DECLARE_CLASS_NAME() static LPCTSTR s_pszClassName;
  43. #define DEFINE_CLASS_NAME( T ) \
  44. _declspec( selectany ) LPCTSTR T::s_pszClassName = _T( #T );
  45. // Declaration of a control name map.
  46. #define DECLARE_CTRL_NAME_MAP() \
  47. DECLARE_CLASS_NAME() \
  48. static const ID_MAP_ENTRY s_rgmapCtrlNames[];
  49. // Beginning of a control name map.
  50. #define BEGIN_CTRL_NAME_MAP( T ) \
  51. DEFINE_CLASS_NAME( T ) \
  52. _declspec( selectany ) const ID_MAP_ENTRY T::s_rgmapCtrlNames[] = {
  53. // Entry in a control name map.
  54. #define DEFINE_CTRL_NAME_MAP_ENTRY( id ) { id, _T( #id ) },
  55. // End of a control name map.
  56. #define END_CTRL_NAME_MAP() { 0, NULL } };
  57. #define DECLARE_ID_STRING( _id ) { _id, _T(#_id) },
  58. #define DECLARE_ID_STRING_2( _id1, _id2 ) { _id1, _T(#_id2) },
  59. #define DECLARE_ID_STRING_EX( _id, _t ) { _id, _T(#_id) _t },
  60. #else // DBG && (defined( _DBG_MSG_NOTIFY ) || defined( _DBG_MSG_COMMAND ))
  61. #define DECLARE_CLASS_NAME()
  62. #define DEFINE_CLASS_NAME( T )
  63. #define DECLARE_CTRL_NAME_MAP()
  64. #define BEGIN_CTRL_NAME_MAP( T )
  65. #define DEFINE_CTRL_NAME_MAP_ENTRY( id )
  66. #define END_CTRL_NAME_MAP()
  67. #endif // DBG && (defined( _DBG_MSG_NOTIFY ) || defined( _DBG_MSG_COMMAND ) || defined( _DBG_MSG ))
  68. /////////////////////////////////////////////////////////////////////////////
  69. // Global Variables
  70. /////////////////////////////////////////////////////////////////////////////
  71. #if DBG && defined( _DBG_MSG )
  72. extern const ID_MAP_ENTRY s_rgmapWindowMsgs[];
  73. #endif // DBG && defined( _DBG_MSG )
  74. #if DBG && defined( _DBG_MSG_COMMAND )
  75. extern const ID_MAP_ENTRY s_rgmapButtonMsgs[];
  76. extern const ID_MAP_ENTRY s_rgmapComboBoxMsgs[];
  77. extern const ID_MAP_ENTRY s_rgmapEditMsgs[];
  78. extern const ID_MAP_ENTRY s_rgmapListBoxMsgs[];
  79. extern const ID_MAP_ENTRY s_rgmapScrollBarMsgs[];
  80. extern const ID_MAP_ENTRY s_rgmapStaticMsgs[];
  81. extern const ID_MAP_ENTRY s_rgmapListViewMsgs[];
  82. extern const ID_MAP_ENTRY s_rgmapTreeViewMsgs[];
  83. extern const ID_MAP_ENTRY s_rgmapIPAddressMsgs[];
  84. #endif // DBG && defined( _DBG_MSG_COMMAND )
  85. #if DBG && defined( _DBG_MSG_NOTIFY )
  86. extern const ID_MAP_ENTRY s_rgmapPropSheetNotifyMsgs[];
  87. #endif // DBG && defined( _DBG_MSG_NOTIFY )
  88. /////////////////////////////////////////////////////////////////////////////
  89. // Global Functions
  90. /////////////////////////////////////////////////////////////////////////////
  91. #if DBG && defined( _DBG_MSG )
  92. // Debug handler for any message
  93. LRESULT DBG_OnMsg(
  94. UINT uMsg,
  95. WPARAM wParam,
  96. LPARAM lParam,
  97. BOOL & bHandled,
  98. LPCTSTR pszClassName
  99. );
  100. #endif // DBG && defined( _DBG_MSG )
  101. #if DBG && defined( _DBG_MSG_NOTIFY )
  102. // Debug handler for the WM_NOTIFY message
  103. LRESULT DBG_OnNotify(
  104. UINT uMsg,
  105. WPARAM wParam,
  106. LPARAM lParam,
  107. BOOL & bHandled,
  108. LPCTSTR pszClassName,
  109. ID_MAP_ENTRY * pmapCtrlNames
  110. );
  111. #endif // DBG && defined( _DBG_MSG_NOTIFY )
  112. #if DBG && defined( _DBG_MSG_COMMAND )
  113. // Debug handler for the WM_COMMAND message
  114. LRESULT DBG_OnCommand(
  115. UINT uMsg,
  116. WPARAM wParam,
  117. LPARAM lParam,
  118. BOOL & bHandled,
  119. LPCTSTR pszClassName,
  120. ID_MAP_ENTRY * pmapCtrlNames
  121. );
  122. #endif // DBG && defined( _DBG_MSG_COMMAND )
  123. /////////////////////////////////////////////////////////////////////////////
  124. #endif // __ATLDBGWIN_H_