[ATL] -Add COMMAND_CODE_HANDLER macro
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 5 Dec 2017 18:32:39 +0000 (20:32 +0200)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 27 Dec 2017 17:25:58 +0000 (19:25 +0200)
sdk/lib/atl/atlwin.h

index 76b1073..fa5301f 100644 (file)
@@ -1800,6 +1800,15 @@ public:
             return TRUE;                                                                        \
     }
 
+#define COMMAND_CODE_HANDLER(code, func)                                                            \
+    if (uMsg == WM_COMMAND && code == HIWORD(wParam))                                                \
+    {                                                                                            \
+        bHandled = TRUE;                                                                        \
+        lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled);                    \
+        if (bHandled)                                                                            \
+            return TRUE;                                                                        \
+    }
+
 #define COMMAND_RANGE_HANDLER(idFirst, idLast, func)                                            \
     if (uMsg == WM_COMMAND && LOWORD(wParam) >= idFirst  && LOWORD(wParam) <= idLast)            \
     {                                                                                            \