[ATL] Add COMMAND_HANDLER macro.
authorMark Jansen <mark.jansen@reactos.org>
Sat, 21 Apr 2018 10:48:08 +0000 (12:48 +0200)
committerMark Jansen <mark.jansen@reactos.org>
Sun, 22 Apr 2018 15:38:38 +0000 (17:38 +0200)
CORE-14543

sdk/lib/atl/atlwin.h

index 02b078e..a4f717c 100644 (file)
@@ -1804,6 +1804,15 @@ public:
             return TRUE;                                                                        \
     }
 
+#define COMMAND_HANDLER(id, code, func)                                                         \
+    if (uMsg == WM_COMMAND && id == LOWORD(wParam) && code == HIWORD(wParam))                   \
+    {                                                                                           \
+        bHandled = TRUE;                                                                        \
+        lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled);                 \
+        if (bHandled)                                                                           \
+            return TRUE;                                                                        \
+    }
+
 #define COMMAND_ID_HANDLER(id, func)                                                            \
     if (uMsg == WM_COMMAND && id == LOWORD(wParam))                                                \
     {                                                                                            \