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.

123 lines
3.8 KiB

  1. //
  2. //
  3. //
  4. // This file cannot be compiled as a C++ file, otherwise the linker
  5. // will bail on unresolved externals (even with extern "C" wrapping
  6. // this).
  7. #include "priv.h"
  8. //#include <windows.h>
  9. //#include <ccstock.h>
  10. // Define some things for debug.h
  11. //
  12. #define SZ_DEBUGINI "ccshell.ini"
  13. #define SZ_DEBUGSECTION "browseui"
  14. #define SZ_MODULE "BROWSEUI"
  15. #define DECLARE_DEBUG
  16. #include <debug.h>
  17. // Include the standard helper functions to dump common ADTs
  18. #include "..\inc\dump.c"
  19. #ifdef DEBUG
  20. void DumpMsg(LPCTSTR pszLabel, MSG * pmsg)
  21. {
  22. ASSERT(IS_VALID_STRING_PTR(pszLabel, -1));
  23. ASSERT(pmsg);
  24. switch (pmsg->message)
  25. {
  26. case WM_LBUTTONDOWN:
  27. TraceMsg(TF_ALWAYS, "%s: msg = WM_LBUTTONDOWN hwnd = %#08lx x = %d y = %d",
  28. pszLabel, pmsg->hwnd, pmsg->pt.x, pmsg->pt.y);
  29. TraceMsg(TF_ALWAYS, " keys = %#04lx x = %d y = %d",
  30. pmsg->wParam, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  31. break;
  32. case WM_LBUTTONUP:
  33. TraceMsg(TF_ALWAYS, "%s: msg = WM_LBUTTONUP hwnd = %#08lx x = %d y = %d",
  34. pszLabel, pmsg->hwnd, pmsg->pt.x, pmsg->pt.y);
  35. TraceMsg(TF_ALWAYS, " keys = %#04lx x = %d y = %d",
  36. pmsg->wParam, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  37. break;
  38. case WM_KEYDOWN:
  39. case WM_SYSKEYDOWN:
  40. case WM_KEYUP:
  41. case WM_SYSKEYUP:
  42. BLOCK
  43. {
  44. LPTSTR pcsz = TEXT("(unknown)");
  45. switch (pmsg->message)
  46. {
  47. STRING_CASE(WM_KEYDOWN);
  48. STRING_CASE(WM_SYSKEYDOWN);
  49. STRING_CASE(WM_KEYUP);
  50. STRING_CASE(WM_SYSKEYUP);
  51. }
  52. TraceMsg(TF_ALWAYS, "%s: msg = %s hwnd = %#08lx",
  53. pszLabel, pcsz, pmsg->hwnd);
  54. TraceMsg(TF_ALWAYS, " vk = %#04lx count = %u flags = %#04lx",
  55. pmsg->wParam, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  56. }
  57. break;
  58. case WM_CHAR:
  59. case WM_SYSCHAR:
  60. BLOCK
  61. {
  62. LPTSTR pcsz = TEXT("(unknown)");
  63. switch (pmsg->message)
  64. {
  65. STRING_CASE(WM_CHAR);
  66. STRING_CASE(WM_SYSCHAR);
  67. }
  68. TraceMsg(TF_ALWAYS, "%s: msg = %s hwnd = %#08lx",
  69. pszLabel, pcsz, pmsg->hwnd);
  70. TraceMsg(TF_ALWAYS, " char = '%c' count = %u flags = %#04lx",
  71. pmsg->wParam, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  72. }
  73. break;
  74. case WM_MOUSEMOVE:
  75. #if 0
  76. TraceMsg(TF_ALWAYS, "%s: msg = WM_MOUSEMOVE hwnd = %#08lx x=%d y=%d",
  77. pszLabel, pmsg->hwnd, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  78. #endif
  79. break;
  80. case WM_TIMER:
  81. #if 0
  82. TraceMsg(TF_ALWAYS, "%s: msg = WM_TIMER hwnd = %#08lx x = %d y = %d",
  83. pszLabel, pmsg->hwnd, pmsg->pt.x, pmsg->pt.y);
  84. TraceMsg(TF_ALWAYS, " id = %#08lx",
  85. pmsg->wParam);
  86. #endif
  87. break;
  88. case WM_MENUSELECT:
  89. TraceMsg(TF_ALWAYS, "%s: msg = WM_MENUSELECT hwnd = %#08lx x = %d y = %d",
  90. pszLabel, pmsg->hwnd, pmsg->pt.x, pmsg->pt.y);
  91. TraceMsg(TF_ALWAYS, " uItem = %#04lx flags = %#04lx hmenu = %#08lx",
  92. GET_WM_MENUSELECT_CMD(pmsg->wParam, pmsg->lParam),
  93. GET_WM_MENUSELECT_FLAGS(pmsg->wParam, pmsg->lParam),
  94. GET_WM_MENUSELECT_HMENU(pmsg->wParam, pmsg->lParam));
  95. break;
  96. default:
  97. if (WM_USER > pmsg->message)
  98. {
  99. TraceMsg(TF_ALWAYS, "%s: msg = %#04lx hwnd=%#04lx wP=%#08lx lP=%#08lx",
  100. pszLabel, pmsg->message, pmsg->hwnd, pmsg->wParam, pmsg->lParam);
  101. }
  102. break;
  103. }
  104. }
  105. #endif