Let's say you're creating an ATL CWindowImpl
class with one or more CContainedWindow
s. And then let's say you want to chain some of the CContainedWindow
s' ALT_MSG_MAP
s so that a couple windows share some base functionality in their window procedures. But during those shared procedures, you're gonna want to know which window is receiving a given message. ATL doesn't pass HWNDs in its message map handler functions. So is there another way to determine which HWND you're dealing with?
Actually, I'm not sure yet, but I think this might work:
#define MESSAGE_HANDLER_EX(msg, func) \
if(uMsg == msg) \
{ \
bHandled = TRUE; \
lResult = func(hWnd, uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
And then the handler function should have a signature like: LRESULT HandlerFunc(HWND, UINT, WPARAM, LPARAM, BOOL&)
.