CallWndProc

3.1

  LRESULT CALLBACK CallWndProc(code, wParam, lParam)    
  int code; /* process-message flag, */  
  WPARAM wParam; /* current-task flag, */  
  LPARAM lParam; /* address of structure with message data */

The CallWndProc function is a library-defined callback function that the system calls whenever the SendMessage function is called. The system passes the message to the callback function before passing the message to the destination window procedure.

Parameters

code

Specifies whether the callback function should process the message or call the CallNextHookEx function. If the code parameter is less than zero, the callback function should pass the message to CallNextHookEx without further processing.

wParam

Specifies whether the message is sent by the current task. This parameter is nonzero if the message is sent; otherwise, it is NULL.

lParam

Points to a structure that contains details about the message. The following shows the order, type, and description of each member of the structure:

Member Description

lParam Contains the lParam parameter of the message.
wParam Contains the wParam parameter of the message.
uMsg Specifies the message.
hWnd Identifies the window that will receive the message.

Return Value

The callback function should return zero.

Comments

The CallWndProc callback function can examine or modify the message as necessary. Once the function returns control to the system, the message, with any modifications, is passed on to the window procedure.

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

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

CallWndProc 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, SendMessage, SetWindowsHookEx