Reputation: 3736
I am learning WINAPI. When I want to programming to get message and then to do some specific operation. I got an error from VC6.0.
For example, I want get wm_keydown message.
code like this:
// .h file
int MainDlg_OnKeyDown(HWND hwnd,WPARAM wParam, LPARAM lParam);
|
HANDLE_MSG(hWnd, WM_KEYDOWN, MainDlg_OnKeyDown);
int MainDlg_OnKeyDown(HWND hwnd, int id, WPARAM wParam, LPARAM lParam)
{
return 1;
}
error:
error C2660: 'MainDlg_OnKeyDown' : function does not take 5 parameters
there are seems only 4 parameters from HANDLE_MSG Macro. I know that when I use WM_COMMAND I can create a function with 4 parameters.
void MainDlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
But what about WM_NOTIFY, WM_KEYDOWN or other messages? How should I know that how many parameters and what kind of parameters should I set when I create message deploy function to a message. I did not find my answer on MSDN and google.Does any one know this? What does MFC do?
Upvotes: 0
Views: 398
Reputation: 3234
HANDLE_MSG macro is defined in Windowsx.h header.
Note: To use message cracker for WM_NOTIFY you must use HANDLE_WM_NOTIFY macro defined in commctrl.h header.
Upvotes: 4