术语 | getclasslongptr |
释义 | GetClassLongPtr 语法: ULONG_PTR GetClassLongPtr( HWND hWnd, int nIndex ); GetClassLongPtr功能 该GetClassLongPtr函数检索从指定的窗口相关的WNDCLASSEX结构指定的值。 如果要检索一个指针或句柄,这个函数取代GetClassLong功能。 (指针和句柄32在32位微软Windows和64在64位Windows位位。)编写代码是与32位和64位Windows,使用GetClassLongPtr位版本的兼容。 参数 hWnd [in]的窗口句柄,并间接地类所属的窗口。 nIndex [in]指定值来检索。从该增加课时内存值,指定的积极,从零开始的字节偏移的价值要检索。有效值范围在零通过额外的类内存的字节数,减去8,例如,如果您指定的24个或更多字节内存的增加课时,16个值将是第三个整数索引。要检索的任何WNDCLASSEX结构,其他值指定以下值之一。 GCW_ATOM 检索一个原子值唯一标识窗口类。这是相同的原子是RegisterClassEx函数返回。 GCL_CBCLSEXTRA 检索的大小,以字节为单位,与类相关的额外的内存。 GCL_CBWNDEXTRA 检索的大小,以字节为单位,额外的窗口,类中的每个窗口相关的内存。有关如何访问此内存,见GetWindowLongPtr信息。 GCLP_HBRBACKGROUND 检索的句柄与背景刷类关联。 GCLP_HCURSOR 检索句柄与类相关的光标。 GCLP_HICON 检索句柄与类相关的图标。 GCLP_HICONSM 检索的句柄小图标与类相关联。 GCLP_HMODULE 检索模块句柄注册类。 GCLP_MENUNAME 检索到菜单名称字符串的指针。该字符串标识菜单资源与类相关联。 GCL_STYLE 获取窗口类样式位。 GCLP_WNDPROC 检索的地址窗口过程,或办理代表窗口过程的地址。您必须使用CallWindowProc函数来调用窗口过程。 返回值 如果函数成功,返回值是请求的值。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 通过指定储备在与RegisterClassEx函数所使用的WNDCLASSEX结构cbClsExtra成员非零值增加课时的内存。 功能信息 最低DLL版本 user32.dll 在Winuser.h中HeaderDeclared,头文件:winuser.h import libraryUser32.lib 最低操作系统Windows 95,Windows NT 3.1 UnicodeImplemented为ANSI和Unicode版本。 参见 窗口类的概述,GetWindowLongPtr,RegisterClassEx,SetClassLongPtr,窗口类 ==英文原文==GetClassLongPtr Function The GetClassLongPtr function retrieves the specified value from the WNDCLASSEX structure associated with the specified window. If you are retrieving a pointer or a handle, this function supersedes the GetClassLong 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 GetClassLongPtr. Syntax ULONG_PTR GetClassLongPtr( HWND hWnd, int nIndex ); Parameters hWnd [in] Handle to the window and, indirectly, the class to which the window belongs. nIndex [in] Specifies the value to retrieve. To retrieve a value from the extra class memory, specify the positive, zero-based byte offset of the value to be retrieved. Valid values are in the range zero through the number of bytes of extra class memory, minus eight; for example, if you specified 24 or more bytes of extra class memory, a value of 16 would be an index to the third integer. To retrieve any other value from the WNDCLASSEX structure, specify one of the following values. GCW_ATOM Retrieves an ATOM value that uniquely identifies the window class. This is the same atom that the RegisterClassEx function returns. GCL_CBCLSEXTRA Retrieves the size, in bytes, of the extra memory associated with the class. GCL_CBWNDEXTRA Retrieves the size, in bytes, of the extra window memory associated with each window in the class. For information on how to access this memory, see GetWindowLongPtr . GCLP_HBRBACKGROUND Retrieves a handle to the background brush associated with the class. GCLP_HCURSOR Retrieves a handle to the cursor associated with the class. GCLP_HICON Retrieves a handle to the icon associated with the class. GCLP_HICONSM Retrieves a handle to the small icon associated with the class. GCLP_HMODULE Retrieves a handle to the module that registered the class. GCLP_MENUNAME Retrieves the pointer to the menu name string. The string identifies the menu resource associated with the class. GCL_STYLE Retrieves the window-class style bits. GCLP_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. 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 . Remarks Reserve extra class memory by specifying a nonzero value in the cbClsExtra 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 , GetWindowLongPtr , RegisterClassEx , SetClassLongPtr , WNDCLASSEX ==原始网址==http://msdn.microsoft.com/en-us/library/ms633581(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。