i'm using c++ mfc and declare message in my dlg:
LRESULT CMyWnd2::OnMyMessage(WPARAM wParam, LPARAM lParam)
{
wParam=5;
lParam=6;
return 0;
}
using code:
WPARAM w=0;
LPARAM l=0;
SendMessage(hwnd,messageId,w,l);
cout<<w<<l<<endl;
print:
0
0
how can i change the values of w / l parameters?
A function can not change the parameters passed in by value.
However, you can pass a pointer to whatever data structure you want in LPARAM, and modify that data structure in your message handler.
Here is how you can use it:
and the message handler: