[ATL] -Add COMMAND_CODE_HANDLER macro

This commit is contained in:
Giannis Adamopoulos 2017-12-05 20:32:39 +02:00
parent bf51ed17f8
commit deb908b038

View 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) \
{ \