[SDK][INCLUDE] msgdump.h registered message support
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Sat, 1 Jun 2019 07:21:33 +0000 (16:21 +0900)
committerKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Sat, 1 Jun 2019 07:21:33 +0000 (16:21 +0900)
sdk/include/reactos/msgdump.h

index 209ce54..514914a 100644 (file)
@@ -2,10 +2,10 @@
  * PROJECT:     ReactOS header files
  * LICENSE:     CC-BY-4.0 (https://spdx.org/licenses/CC-BY-4.0.html)
  * PURPOSE:     Win32API message dumping
- * COPYRIGHT:   Copyright 2018 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
+ * COPYRIGHT:   Copyright 2018-2019 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
  */
 #ifndef _INC_MSGDUMP
-#define _INC_MSGDUMP    4   /* Version 4 */
+#define _INC_MSGDUMP    5   /* Version 5 */
 
 /*
  * NOTE: MD_msgdump function in this file provides Win32API message dump feature.
@@ -61,6 +61,17 @@ MD_rect_text(TCHAR *buf, size_t bufsize, const RECT *prc)
 static __inline LRESULT MSGDUMP_API
 MD_OnUnknown(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
+    TCHAR szName[64];
+    if (0xC000 <= uMsg && uMsg <= 0xFFFF &&
+        GlobalGetAtomName(uMsg, szName, ARRAYSIZE(szName)))
+    {
+        // RegisterWindowMessage'd message
+        MSGDUMP_TPRINTF(TEXT("%s'%s'(%u)(hwnd:%p, wParam:%p, lParam:%p)\n"),
+                        MSGDUMP_PREFIX, szName, uMsg, (void *)hwnd, (void *)wParam,
+                        (void *)lParam);
+        return 0;
+    }
+
     MSGDUMP_TPRINTF(TEXT("%sWM_%u(hwnd:%p, wParam:%p, lParam:%p)\n"),
                     MSGDUMP_PREFIX, uMsg, (void *)hwnd, (void *)wParam, (void *)lParam);
     return 0;