User32GetLayeredWindowAttributes(SafeHandle, UInt32, Byte, LayeredWindowAttributesFlags) Method

Retrieves the opacity and transparency color key 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 GetLayeredWindowAttributes(
	SafeHandle hWnd,
	out uint refColorKey,
	out byte refAlpha,
	out LayeredWindowAttributesFlags flags
)

Parameters

hWnd  SafeHandle
A handle to the 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.

refColorKey  UInt32
A COLORREF structure that receives the transparency color key to be used when composing the layered window.

All pixels painted by the window in this color will be transparent.

This can be if the argument is not needed.

refAlpha  Byte
The Alpha value used to describe the opacity of the layered window.

When the variable referred to by refAlpha is 0, the window is completely transparent.

When the variable referred to by refAlpha is 255, the window is opaque.

This can be if the argument is not needed.

flags  LayeredWindowAttributesFlags
An action to be taken.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value .

To get extended error information, call GetLastWin32Error.

Remarks

See Also