User32SetClassLongPtr(HandleRef, ClassLongValues, IntPtr) Method

Replaces the specified value at the specified offset in the extra class memory or the WNDCLASSEX structure for the class to which the specified window belongs.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static IntPtr SetClassLongPtr(
	HandleRef hWnd,
	ClassLongValues value,
	IntPtr newValue
)

Parameters

hWnd  HandleRef
A handle to the window and, indirectly, the class to which the window belongs.
value  ClassLongValues
The value to be replaced.

To set a 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 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.

newValue  IntPtr
The replacement value.

Return Value

IntPtr
If the function succeeds, the return value is the previous value of the specified offset. If this was not previously set, the return value is zero.

If the function fails, the return value is Zero.

To get extended error information, call GetLastWin32Error.

Remarks

See Also