Receive message
-
In a "class CMyCtrl : public CWnd" controller I create another controller dynamically. Can I catch the WM_LBUTTONDOWN message that is intended for the dynamic controller in CMyCtrl instead? /Mathias
(WNDPROC) gfnMyProc; //in some previous called function gfnMyProc = (WNDPROC)SetWindowLong(listview, GWL_WNDPROC,(LONG)MyProc); LRESULT CALLBACK MyProc(HWND hwnd, UINT uiMsg,WPARAM wParam, LPARAM lParam) { switch (uiMsg) { case WM_LBUTTONDOWN: { //your stuff here break; } } return CallWindowProc(gfnMyProc, hwnd, uiMsg, wParam, lParam); }}
Pain is a weakness living the body -
In a "class CMyCtrl : public CWnd" controller I create another controller dynamically. Can I catch the WM_LBUTTONDOWN message that is intended for the dynamic controller in CMyCtrl instead? /Mathias
This should work
(WNDPROC) gfnMyProc; //in some previous called function gfnMyProc = (WNDPROC)SetWindowLong(listview, GWL_WNDPROC,(LONG)MyProc); LRESULT CALLBACK MyProc(HWND hwnd, UINT uiMsg,WPARAM wParam, LPARAM lParam) { switch (uiMsg) { case WM_LBUTTONDOWN: { //your stuff here break; } } return CallWindowProc(gfnMyProc, hwnd, uiMsg, wParam, lParam); }
Pain is a weakness living the body