LRESULT CALLBACK MouseProc(nCode, wParam, lParam) | |||||
int nCode; | /* process-message flag | */ | |||
WPARAM wParam; | /* message identifier | */ | |||
LPARAM lParam; | /* mouse coordinates | */ |
The MouseProc function is an application- or library-defined callback function that the system calls whenever an application calls the GetMessage or PeekMessage function and there is a mouse message to process.
nCode
Specifies whether the callback function should process the message or call the CallNextHookEx function. If this value is less than zero, the callback function should pass the message to CallNextHookEx without further processing. If this value is HC_NOREMOVE, the application is using a PeekMessage function with the PM_NOREMOVE option and the message will not be removed from the system queue.
wParam
Specifies the identifier of the mouse message.
lParam
Specifies the x- and y-coordinates of the mouse. The x-coordinate is in the low-order word; the y-coordinate is in the high-order word. The coordinates are always relative to the upper-left corner of the window.
The callback function should return zero to allow the system to process the message; it should return 1 to discard the message.
This callback function should not install a JournalPlaybackProc callback function.
An application must install the callback function by specifying the WH_MOUSE filter type and the address of the callback function in a call to the SetWindowsHookEx function.
MouseProc is a placeholder for the application- or library-supplied function name. The actual name must be exported by including it in the EXPORTS statement in a module-definition file.
CallNextHookEx, GetMessage, PeekMessage, SetWindowsHookEx