|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| Yes
| Win32s
| Yes
| Import Library
| user32.lib
| Header File
| winuser.h
| Unicode
| WinNT
| Platform Notes
| None
|
|
|
CallWindowProc
The CallWindowProc function passes message information to the specified window procedure.
LRESULT CallWindowProc(
WNDPROC lpPrevWndFunc,
| // pointer to previous procedure
| HWND hWnd,
| // handle to window
| UINT Msg,
| // message
| WPARAM wParam,
| // first message parameter
| LPARAM lParam
| // second message parameter
| );
|
|
Parameters
lpPrevWndFunc
Pointer to the previous window procedure.
If this value is obtained by calling the GetWindowLong function with the nIndex parameter set to GWL_WNDPROC or DWL_DLGPROC, it is actually either the
address of a window or dialog box procedure, or a handle representing that address.
hWnd
Identifies the window procedure to receive the message.
Msg
Specifies the message.
wParam
Specifies additional message-specific information. The contents of this
parameter depend on the value of the Msg parameter.
lParam
Specifies additional message-specific information. The contents of this
parameter depend on the value of the Msg parameter.
Return Values
The return value specifies the result of the message processing and depends on
the message sent.
Remarks
Use the CallWindowProc function for window subclassing. Usually, all windows with the same class
share one window procedure. A subclass is a window or set of windows with the same
class whose messages are intercepted and processed by another window procedure
(or procedures) before being passed to the window procedure of the class.
The SetWindowLong function creates the subclass by changing the window procedure associated
with a particular window, causing Windows to call the new window procedure instead
of the previous one. An application must pass any messages not processed by
the new window procedure to the previous window procedure by calling CallWindowProc. This allows the application to create a chain of window procedures.
If STRICT is defined, the lpPrevWndFunc parameter has the data type WNDPROC. The WNDPROC type is declared as follows:
LRESULT (CALLBACK* WNDPROC) (HWND, UINT, WPARAM, LPARAM);
If STRICT is not defined, the lpPrevWndFunc parameter has the data type FARPROC. The FARPROC type is declared as follows:
int (FAR WINAPI * FARPROC) ()
In C, the FARPROC declaration indicates a callback function that has an unspecified parameter
list. In C++, however, the empty parameter list in the declaration indicates
that a function has no parameters. This subtle distinction can break careless
code. Following is one way to handle this situation:
#ifdef STRICT
WNDPROC MyWindowProcedure
#else
FARPROC MyWindowProcedure
#endif
...
lResult = CallWindowProc(MyWindowProcedure, ...) ;
For further information about functions declared with empty argument lists,
refer to The C++ Programming Language, Second Edition, by Bjarne Stroustrup.
Windows NT: The CallWindowProc function handles Unicode-to-ANSI conversion. You don't get the conversion if
you call the window procedure directly.
See Also
FARPROC, GetWindowLong, SetClassLong, SetWindowLong, WNDPROC
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|