SysMsgProc

3.1

  LRESULT CALLBACK SysMsgProc(code, wParam, lParam)    
  int code; /* message type */
  WPARAM wParam; /* undefined */
  LPARAM lParam; /* pointer to an MSG structure */

The SysMsgProc function is a 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

code

Specifies the type of message being processed. This parameter can be one of the following values:

Value Meaning

MSGF_DIALOGBOX Messages inside a dialog box or message box procedure are being processed.
MSGF_MENU Keyboard and mouse messages in a menu are being processed.

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

wParam

Must be NULL.

lParam

Points to the MSG structure to contain the message. The MSG structure has the following form:

typedef struct tagMSG {     /* msg */
    HWND   hwnd;
    UINT   message;
    WPARAM wParam;
    LPARAM lParam;
    DWORD  time;
    POINT  pt;
} MSG;

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

Return Value

The return value should be nonzero if the function processes the message. Otherwise, it should be zero.

Comments

This callback function must be in a dynamic-link library (DLL).

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

SysMsgProc 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, MessageBox, SetWindowsHookEx