CallWindowProc

Syntax

LONG CallWindowProc(lpPrevWndFunc,hWnd,wMsg,wParam,lParam)

This function passes message information to the function specified by the lpPrevWndFunc parameter. The CallWindowProc function is used for window subclassing. Normally, all windows with the same class share the same window function. A subclass is a window or set of windows belonging to the same window class whose messages are intercepted and processed by another function (or functions) before being passed to the window function of that class.

The SetWindowLong function creates the subclass by changing the window function associated with a particular window, causing Windows to call the new window function instead of the previous one. Any messages not processed by the new window function must be passed to the previous window function by calling CallWindowProc. This allows a chain of window functions to be created.

Parameter Type/Description  

lpPrevWndFunc FARPROC Is the procedure-instance address of the previous window function.  
hWnd HWND Identifies the window that receives the message.  
wMsg WORD Specifies the message number.  
wParam WORD Specifies additional message-dependent information.  
lParam DWORD Specifies additional message-dependent information.  

Return Value

The return value specifies the result of the message processing. The possible return values depend on the message sent.