术语 | getwindowlongptr |
释义 | GetWindowLongPtr 语法: LONG_PTR GetWindowLongPtr( HWND hWnd, int nIndex ); GetWindowLongPtr功能 该GetWindowLongPtr函数检索有关指定的窗口。检索的功能也将在指定的额外窗口内存偏移值。 如果要检索一个指针或句柄,这个函数取代GetWindowLong功能。 (指针和句柄32在32位微软Windows和64在64位Windows位位。)编写代码是与32位和64位Windows,使用GetWindowLongPtr位版本的兼容。 参数 hWnd [in] 窗口句柄,并间接地类所属的窗口。 如果要检索一个指针或句柄,这个函数取代GetWindowLong功能。 (指针和句柄是32位在32位Windows和64位Windows 64位。)编写代码是与32位和64位Windows,使用GetWindowLongPtr位版本的兼容。 nIndex [in]指定零的偏移值来进行检索。有效值范围在零通过额外的窗口内存的字节数,减去一个整数的大小。要检索任何其他值,指定下列值之一。 GWL_EXSTYLE 检索扩展窗口样式。有关更多信息,请参阅CreateWindowEx。 GWL_STYLE 检索窗口样式。 GWLP_WNDPROC 检索到窗口过程,指针或句柄代表指针的窗口过程。您必须使用CallWindowProc函数来调用窗口过程。 GWLP_HINSTANCE 检索处理的应用程序实例。 GWLP_HWNDPARENT 检索的句柄父窗口,如果有一个。 GWLP_ID 检索窗口的标识符。 GWLP_USERDATA 用户检索与窗口相关的数据。这些数据是为应用程序创建窗口的使用。最初它的价值为零。 下面的值也可当hWnd参数标识一个对话框。 DWLP_DLGPROC 检索到对话框过程,指针或句柄代表指针对话框过程。您必须使用CallWindowProc函数来调用对话框过程。 DWLP_MSGRESULT 检索在对话框过程处理消息的返回值。 DWLP_USER 额外的信息检索私有的应用程序,如处理或指针。 返回值 如果函数成功,返回值是请求的值。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 如果SetWindowLong函数或SetWindowLongPtr尚未调用以前,GetWindowLongPtr返回零在多窗口或类内存值。 备注 通过指定储备在与RegisterClassEx函数所使用的WNDCLASSEX结构cbWndExtra成员非零值额外的窗口内存。 功能信息 最低DLL版本 user32.dll 在Winuser.h中HeaderDeclared,头文件:winuser.h import libraryUser32.lib 最低操作系统Windows 95,Windows NT 3.1 UnicodeImplemented为ANSI和Unicode版本。 参见 窗口类的概述,CallWindowProc,RegisterClassEx,SetParent,SetWindowLongPtr,窗口类 ==英文原文==GetWindowLongPtr Function The GetWindowLongPtr function retrieves information about the specified window. The function also retrieves the value at a specified offset into the extra window memory. If you are retrieving a pointer or a handle, this function supersedes the GetWindowLong 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_PTR GetWindowLongPtr( HWND hWnd, int nIndex ); Parameters hWnd [in] Handle to the window and, indirectly, the class to which the window belongs. If you are retrieving a pointer or a handle, this function supersedes the GetWindowLong function. (Pointers and handles are 32 bits on 32-bit 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. 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 the size of an 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 . GWLP_WNDPROC Retrieves the pointer to the window procedure, or a handle representing the pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. GWLP_HINSTANCE Retrieves a handle to the application instance. GWLP_HWNDPARENT Retrieves a handle to the parent window, if there is one. GWLP_ID Retrieves the identifier of the window. GWLP_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. DWLP_DLGPROC Retrieves the pointer to the dialog box procedure, or a handle representing the pointer to the dialog box procedure. You must use the CallWindowProc function to call the dialog box procedure. DWLP_MSGRESULT Retrieves the return value of a message processed in the dialog box procedure. DWLP_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 value. If the function fails, the return value is zero. To get extended error information, call GetLastError . If SetWindowLong or SetWindowLongPtr has not been called previously, GetWindowLongPtr 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. 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 , RegisterClassEx , SetParent , SetWindowLongPtr , WNDCLASSEX ==原始网址==http://msdn.microsoft.com/en-us/library/ms633585(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。