网站首页  词典首页

请输入您要查询的函数:

 

术语 setclasslong
释义 SetClassLong
语法:
DWORD SetClassLong( HWND hWnd,
int nIndex,
LONG dwNewLong
);
SetClassLong函数
替换的SetClassLong函数在指定到内存或增加课时为哪一等级指定的窗口所属WNDCLASSEX结构抵消指定的32位(长)值。
注意:此功能已被取代的SetClassLongPtr功能。要编写的代码是与32位和64位的Microsoft Windows,使用SetClassLongPtr位版本的兼容。
参数
hWnd
[in]的窗口句柄,并间接地类所属的窗口。
nIndex
[in]指定的32位值来取代。要设定额外的类内存32位的值,指定的积极,从零开始的字节偏移值被设置。有效值范围在零通过额外的类内存的字节数,再减去4,例如,如果您指定了12个或多个字节内存的增加课时,为8价值将是第三个32位整数指数。要设置的WNDCLASSEX结构,任何其他值指定以下值之一。
GCL_CBCLSEXTRA
设置大小,以字节为单位,与类相关的额外的内存。设置此值不会改变已拨出额外的字节数。
GCL_CBWNDEXTRA
设置大小,以字节,额外的窗口,类中的每个窗口相关的内存。设置此值不会改变已拨出额外的字节数。有关如何访问此内存的信息,请参阅SetWindowLong函数。
GCL_HBRBACKGROUND
替换的句柄与背景刷类关联。
GCL_HCURSOR
取代了手柄与类相关的光标。
GCL_HICON
取代了手柄与类相关的图标。
GCL_HICONSM
替换的句柄小图标与类相关联。
GCL_HMODULE
替换一个模块句柄注册类。
GCL_MENUNAME
替换的菜单名称字符串的地址。该字符串标识菜单资源与类相关联。
GCL_STYLE
替换窗口类样式位。
GCL_WNDPROC
取代了与类相关的窗口过程地址。
dwNewLong
[in]指定替代的价值。
返回值
如果函数成功,返回值是指定的32位整数以前的值。如果该值不是以前设置,返回值是零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
如果您使用SetClassLong函数和GCL_WNDPROC指数,以取代窗口程序,窗口过程必须符合在的WindowProc回调函数的描述中指定的指导方针。
调用与GCL_WNDPROC指数SetClassLong创建一个窗口类,影响其后的类创建的所有窗口的子类。应用程序可以子类系统类,但不应子窗口类由另一个进程创建的。
通过指定储备在与RegisterClassEx函数所使用的WNDCLASSEX结构cbClsExtra成员非零值增加课时的内存。
使用保健SetClassLong功能。例如,它有可能改变使用SetClassLong为一类的背景颜色,但这种改变不会立即重新绘制所有的窗口属于类。
在Windows 95/98/Me:SetClassLongW是支持的Unicode(MSLU)微软层。请注意,此功能后续调用将覆盖以前呼吁的结果,所以您必须保存任何结果,您要使用更高版本。若要使用此版本,您必须添加一些文件到您的应用,概述了对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版本。
参见
窗口类的概述,GetClassLong,RegisterClassEx,SetClassLongPtr,SetWindowLong函数,的WindowProc,窗口类
==英文原文==SetClassLong Function
The SetClassLong function replaces the specified 32-bit (long) value at the specified offset into the extra class memory or the WNDCLASSEX structure for the class to which the specified window belongs.
Note This function has been superseded by the SetClassLongPtr function. To write code that is compatible with both 32-bit and 64-bit versions of Microsoft Windows, use SetClassLongPtr.
Syntax
DWORD SetClassLong( HWND hWnd,
int nIndex,
LONG dwNewLong
);
Parameters
hWnd
[in] Handle to the window and, indirectly, the class to which the window belongs.
nIndex
[in] Specifies the 32-bit value to replace. To set a 32-bit value in the extra class memory, specify the positive, zero-based byte offset of the value to be set. Valid values are in the range zero through the number of bytes of extra class memory, minus four; for example, if you specified 12 or more bytes of extra class memory, a value of 8 would be an index to the third 32-bit integer. To set any other value from the WNDCLASSEX structure, specify one of the following values.
GCL_CBCLSEXTRA
Sets the size, in bytes, of the extra memory associated with the class. Setting this value does not change the number of extra bytes already allocated.
GCL_CBWNDEXTRA
Sets the size, in bytes, of the extra window memory associated with each window in the class. Setting this value does not change the number of extra bytes already allocated. For information on how to access this memory, see SetWindowLong .
GCL_HBRBACKGROUND
Replaces a handle to the background brush associated with the class.
GCL_HCURSOR
Replaces a handle to the cursor associated with the class.
GCL_HICON
Replaces a handle to the icon associated with the class.
GCL_HICONSM
Replace a handle to the small icon associated with the class.
GCL_HMODULE
Replaces a handle to the module that registered the class.
GCL_MENUNAME
Replaces the address of the menu name string. The string identifies the menu resource associated with the class.
GCL_STYLE
Replaces the window-class style bits.
GCL_WNDPROC
Replaces the address of the window procedure associated with the class.
dwNewLong
[in] Specifies the replacement value.
Return Value
If the function succeeds, the return value is the previous value of the specified 32-bit integer. If the value was not previously set, the return value is zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
If you use the SetClassLong function and the GCL_WNDPROC index to replace the window procedure, the window procedure must conform to the guidelines specified in the description of the WindowProc callback function.
Calling SetClassLong with the GCL_WNDPROC index creates a subclass of the window class that affects all windows subsequently created with the class. An application can subclass a system class, but should not subclass a window class created by another process.
Reserve extra class memory by specifying a nonzero value in the cbClsExtra member of the WNDCLASSEX structure used with the RegisterClassEx function.
Use the SetClassLong function with care. For example, it is possible to change the background color for a class by using SetClassLong, but this change does not immediately repaint all windows belonging to the class.
Windows 95/98/Me: SetClassLongW is supported by the Microsoft Layer for Unicode (MSLU). Note that subsequent calls to this function will overwrite the results of previous calls, so you must save any results that you want to use later. To use this version, 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 Displaying an Icon .
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 , GetClassLong , RegisterClassEx , SetClassLongPtr , SetWindowLong , WindowProc , WNDCLASSEX
==原始网址==http://msdn.microsoft.com/en-us/library/ms633588(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:23:26