网站首页  词典首页

请输入您要查询的函数:

 

术语 getwindowlong
释义 GetWindowLong
语法:
LONG GetWindowLong( HWND hWnd,
int nIndex
);
GetWindowLong函数
该GetWindowLong函数检索有关指定的窗口。检索的功能也将在指定的额外的窗口内存偏移的32位(长)值。
如果要检索一个指针或句柄,这个功能已被取代的GetWindowLongPtr功能。 (指针和句柄32在32位微软Windows和64在64位Windows位位。)编写代码是与32位和64位Windows,使用GetWindowLongPtr位版本的兼容。
参数
hWnd
[in]的窗口句柄,并间接地类所属的窗口。
nIndex
[in]指定零的偏移值来进行检索。有效值范围在零通过额外的窗口内存的字节数,再减去4,例如,如果您指定的12个或更多个字节的额外的内存,为8价值将是第三个32位整数索引。要检索任何其他值,指定下列值之一。
GWL_EXSTYLE
检索扩展窗口样式。有关更多信息,请参阅CreateWindowEx。
GWL_STYLE
检索窗口样式。
千万要小心
检索的地址窗口过程,或办理代表窗口过程的地址。您必须使用CallWindowProc函数来调用窗口过程。
GWL_HINSTANCE
检索处理的应用程序实例。
GWL_HWNDPARENT
检索的句柄父窗口,如果有的话。
GWL_ID
检索窗口的标识符。
GWL_USERDATA
用户检索与窗口相关的数据。这些数据是为应用程序创建窗口的使用。最初它的价值为零。
下面的值也可当hWnd参数标识一个对话框。
DWL_DLGPROC
检索报告对话框的程序,或办理代表对话框过程的地址。您必须使用CallWindowProc函数来调用对话框过程。
DWL_MSGRESULT
检索在对话框过程处理消息的返回值。
DWL_USER
额外的信息检索私有的应用程序,如处理或指针。
返回值
如果函数成功,返回值是所要求的32位值。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
如果SetWindowLong函数没有被调用之前,GetWindowLong返回零在多窗口或类内存值。
备注
通过指定储备在与RegisterClassEx函数所使用的WNDCLASSEX结构cbWndExtra成员非零值额外的窗口内存。
在Windows 95/98/Me:GetWindowLongW是支持的Unicode(MSLU)微软层。 GetWindowLongA也支持,提供更一致的行为,在所有的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版本。
参见
窗口类的概述,CallWindowProc,GetWindowLongPtr,RegisterClassEx,SetParent,SetWindowLong函数,窗口类
==英文原文==GetWindowLong Function
The GetWindowLong function retrieves information about the specified window. The function also retrieves the 32-bit (long) value at the specified offset into the extra window memory.
If you are retrieving a pointer or a handle, this function has been superseded by the GetWindowLongPtr function. (Pointers and handles are 32 bits on 32-bit Microsoft Windows and 64 bits on 64-bit Windows.) To write code that is compatible with both 32-bit and 64-bit versions of Windows, use GetWindowLongPtr.
Syntax
LONG GetWindowLong( HWND hWnd,
int nIndex
);
Parameters
hWnd
[in] Handle to the window and, indirectly, the class to which the window belongs.
nIndex
[in] Specifies the zero-based offset to the value to be retrieved. Valid values are in the range zero through the number of bytes of extra window memory, minus four; for example, if you specified 12 or more bytes of extra memory, a value of 8 would be an index to the third 32-bit integer. To retrieve any other value, specify one of the following values.
GWL_EXSTYLE
Retrieves the extended window styles. For more information, see CreateWindowEx .
GWL_STYLE
Retrieves the window styles .
GWL_WNDPROC
Retrieves the address of the window procedure, or a handle representing the address of the window procedure. You must use the CallWindowProc function to call the window procedure.
GWL_HINSTANCE
Retrieves a handle to the application instance.
GWL_HWNDPARENT
Retrieves a handle to the parent window, if any.
GWL_ID
Retrieves the identifier of the window.
GWL_USERDATA
Retrieves the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero.
The following values are also available when the hWnd parameter identifies a dialog box.
DWL_DLGPROC
Retrieves the address of the dialog box procedure, or a handle representing the address of the dialog box procedure. You must use the CallWindowProc function to call the dialog box procedure.
DWL_MSGRESULT
Retrieves the return value of a message processed in the dialog box procedure.
DWL_USER
Retrieves extra information private to the application, such as handles or pointers.
Return Value
If the function succeeds, the return value is the requested 32-bit value.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
If SetWindowLong has not been called previously, GetWindowLong returns zero for values in the extra window or class memory.
Remarks
Reserve extra window memory by specifying a nonzero value in the cbWndExtra member of the WNDCLASSEX structure used with the RegisterClassEx function.
Windows 95/98/Me: GetWindowLongW is supported by the Microsoft Layer for Unicode (MSLU). GetWindowLongA is also supported to provide more consistent behavior across all Windows operating systems. To use these versions, 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 Creating, Enumerating, and Sizing Child Windows .
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 Classes Overview , CallWindowProc , GetWindowLongPtr , RegisterClassEx , SetParent , SetWindowLong , WNDCLASS
==原始网址==http://msdn.microsoft.com/en-us/library/ms633584(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 13:25:43