MouseProc

3.1

  LRESULT CALLBACK MouseProc(code, wParam, lParam)    
  int code; /* process-message flag, */  
  WPARAM wParam; /* message identifier, */  
  LPARAM lParam; /* address of MOUSEHOOKSTRUCT structure */

The MouseProc function is a library-defined callback function that the system calls whenever an application calls the GetMessage or PeekMessage function and there is a mouse message to be processed.

Parameters

code

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

Points to a MOUSEHOOKSTRUCT structure containing information about the mouse. The MOUSEHOOKSTRUCT structure has the following form:

typedef struct tagMOUSEHOOKSTRUCT { /* ms */
    POINT   pt;
    HWND    hwnd;
    UINT    wHitTestCode;
    DWORD   dwExtraInfo;
} MOUSEHOOKSTRUCT;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

The callback function should return 0 to allow the system to process the message; it should return 1 to discard the message.

Comments

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 procedure-instance address of the callback function in a call to the SetWindowsHookEx function.

MouseProc is a placeholder for the library-defined function name. The actual name must be exported by including it in an EXPORTS statement in the library's module-definition file.

See Also

CallNextHookEx, GetMessage, PeekMessage, SetWindowsHookEx