User32UpdateLayeredWindow(IntPtr, IntPtr, NativePoint, NativeSize, IntPtr, NativePoint, Int32, BlendFunction, UpdateLayeredWindowflags) Method

Updates the position, size, shape, content, and translucency of a layered window.

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 bool UpdateLayeredWindow(
	IntPtr hWnd,
	IntPtr hdcDst,
	ref NativePoint refPtrDst,
	ref NativeSize refSize,
	IntPtr hdcSrc,
	ref NativePoint refPtrSrc,
	int crKey,
	ref BlendFunction refBlend,
	UpdateLayeredWindowflags flags
)

Parameters

hWnd  IntPtr
A handle to a layered window.

A layered window is created by specifying Layered when creating the window with the CreateWindowEx function or by setting Layered via SetWindowLongPtr(IntPtr, WindowLongValues, IntPtr) function. after the window has been created.

hdcDst  IntPtr
A handle to a device context (DC) for the screen.

This handle is obtained by specifying NULL when calling the function.

It is used for palette color matching when the window contents are updated.

If hdcDst is Zero, the default palette will be used.

refPtrDst  NativePoint
A pointer to a structure that specifies the new screen position of the layered window.

If the current position is not changing, refPtrDst can be Zero.

refSize  NativeSize
A pointer to a structure that specifies the new size of the layered window.

If the size of the window is not changing, refSize can be .

If hdcSrc is Zero, refSize must be .

hdcSrc  IntPtr
A handle to a device context (DC) for the surface that defines the layered window.

This handle can be obtained by calling the CreateCompatibleDC(IntPtr) function.

If the shape and visual context of the window are not changing, hdcSrc can be Zero.

refPtrSrc  NativePoint
A pointer to a structure that specifies the location of the layer in the device context.

If hdcSrc is Zero, pptSrc should be .

crKey  Int32
A structure that specifies the color key to be used when composing the layered window.

To generate a COLORREF, use the RGB macro.

refBlend  BlendFunction
A pointer to a structure that specifies the transparency value to be used when composing the layered window.
flags  UpdateLayeredWindowflags
The flags.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also