SysMsgProc

  LRESULT CALLBACK SysMsgProc(nCode, wParam, lParam)    
  int nCode; /* message type */
  WPARAM wParam; /* undefined */
  LPARAM lParam; /* address of structure with message data */

The SysMsgProc function is an application- or library-defined callback function that the system calls after a dialog box, message box, or menu has retrieved a message, but before the message is processed. The callback function can process or modify messages for any application in the system.

Parameters

nCode

Specifies the type of message being processed. It must be one of the following values:

Value Meaning

MSGF_DIALOGBOX  
  Processing messages inside a dialog box or message box procedure.
MSGF_MENU  
  Processing keyboard and mouse messages in menu.

If the nCode parameter is less than zero, the callback function must pass the message to CallNextHookEx without further processing and return the value returned by CallNextHookEx.

wParam

Specifies a NULL value.

lParam

Points to an MSG message structure.

The MSG structure has the following form:

typedef struct tagMSG { /* msg */

HWND hwnd;

UINT message;

WPARAM wParam;

LPARAM lParam;

DWORD time;

POINT pt;

} MSG;

Return Value

The callback function should return a nonzero value if it processes the message; otherwise, it should return zero.

Comments

An application must install the callback function by specifying the WH_SYSMSGFILTER filter type and the address of the callback function in a call to the SetWindowsHookEx function.

SysMsgProc is a placeholder for the library-supplied function name. The actual name must be exported by including it in the EXPORTS statement in a module-definition file.

See Also

CallNextHookEx, MessageBox, SetWindowsHookEx