User32SetWindowLong(SafeHandle, WindowLongValues, UInt32) Method

Note: This API is now obsolete.
Changes an attribute of the specified window.

The function also sets the 32-bit (LONG) value at the specified offset into the extra window memory.

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)]
[ObsoleteAttribute("Call SetWindowLongPtr instead.", false)]
public static uint SetWindowLong(
	SafeHandle hWnd,
	WindowLongValues flags,
	uint newLong
)

Parameters

hWnd  SafeHandle
A handle to the window and, indirectly, the class to which the window belongs.
flags  WindowLongValues
The zero-based offset to the value to be set.

Valid values are in the range zero through the number of bytes of extra window memory, minus the size of an integer.

newLong  UInt32
The replacement value.

Return Value

UInt32
If the function succeeds, the return value is the previous value of the specified 32-bit integer.

If the function fails, the return value is zero.

If the previous value of the specified 32-bit integer is zero, and the function succeeds, the return value is zero.

To get extended error information, call GetLastWin32Error.

Remarks

See Also