网站首页  词典首页

请输入您要查询的函数:

 

术语 callwindowproc
释义 CallWindowProc
语法:
LRESULT CallWindowProc( WNDPROC lpPrevWndFunc,
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
CallWindowProc函数
该CallWindowProc函数传递消息的信息到指定的窗口过程。
参数
lpPrevWndFunc
[in]指向前一个窗口过程。如果此值是通过调用设置为千万要小心或DWL_DLGPROC的nIndex参数GetWindowLong函数获得,它实际上不是一个窗口或对话框的程序,或者是特殊的内在价值仅CallWindowProc有意义的解决。
hWnd
[in]的窗口句柄程序接收消息。
消息
[in]指定的消息。
wParam
[in]指定附加消息的特定信息。这个参数的内容取决于对消息参数的值。
lparam的
[in]指定附加消息的特定信息。这个参数的内容取决于对消息参数的值。
返回值
返回值指定消息处理的结果,取决于对信息发送。
备注
使用窗口子类CallWindowProc功能。通常,同一类共享一个窗口过程的所有窗口。子类是一个窗口或Windows设置相同的类邮件被拦截和另一个窗口程序(或程序)加工后,传递给类的窗口过程。
SetWindowLong函数创建通过改变窗口过程与特定的窗口相关的子类,导致系统调用新的窗口过程而不是以前的1。应用程序必须通过没有新的窗口过程到以前的窗口过程处理,通过调用CallWindowProc任何消息。这允许应用程序创建一个窗口程序链。
如果严格界定,lpPrevWndFunc参数的数据类型的WndProc。该类型的WndProc声明如下:
LRESULT(回调*的WndProc)(的HWND,机组,WPARAM,lparam的);
如果没有严格的定义,lpPrevWndFunc参数的数据FARPROC类型。该FARPROC类型声明如下:
廉政(远东WINAPI * FARPROC)()
在C中,FARPROC宣言表明回调函数,有一个未指定的参数列表。在C + +,但是,在宣言空参数表显示,函数没有参数。这种微妙的区别可以打破不小心代码。以下是其中一个方法来处理这种情况:
#ifdef STRICT
WNDPROC MyWindowProcedure
#else
FARPROC MyWindowProcedure
#endif
...
lResult = CallWindowProc(MyWindowProcedure, ...) ;
如需有关使用空参数列表函数声明的进一步资料,请参考C + +的由Bjarne Stroustrup编程语言,第二版。
Windows NT/2000/XP的:在CallWindowProc函数处理的Unicode到ANSI转换。您不能把这种优势转化如果调用程序的窗口,直接。
在Windows 95/98/Me:CallWindowProcW是支持的Unicode(MSLU)微软层。此外,ANSI版本的支持,提供更一致的行为在所有Microsoft Windows操作系统。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
例如
有关示例,请参见子类化一个窗口
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
窗口过程概述,GetWindowLong,SetClassLong,SetWindowLong函数
==英文原文==CallWindowProc Function
The CallWindowProc function passes message information to the specified window procedure.
Syntax
LRESULT CallWindowProc( WNDPROC lpPrevWndFunc,
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
Parameters
lpPrevWndFunc
[in] 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 special internal value meaningful only to CallWindowProc.
hWnd
[in] Handle to the window procedure to receive the message.
Msg
[in] Specifies the message.
wParam
[in] Specifies additional message-specific information. The contents of this parameter depend on the value of the Msg parameter.
lParam
[in] Specifies additional message-specific information. The contents of this parameter depend on the value of the Msg parameter.
Return Value
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 the system 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/2000/XP: The CallWindowProc function handles Unicode-to-ANSI conversion. You cannot take advantage of this conversion if you call the window procedure directly.
Windows 95/98/Me: CallWindowProcW is supported by the Microsoft Layer for Unicode (MSLU). Also, the ANSI version is supported, to provide more consistent behavior across all Microsoft Windows operating systems. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Example
For an example, see Subclassing a Window
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Window Procedures Overview , GetWindowLong , SetClassLong , SetWindowLong
==原始网址==http://msdn.microsoft.com/en-us/library/ms633571(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:30:16