User32GetLayeredWindowAttributes(SafeHandle, UInt32, Byte, LayeredWindowAttributesFlags) Method
Retrieves the opacity and transparency color key of a layered window.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function GetLayeredWindowAttributes (
hWnd As SafeHandle,
<OutAttribute> ByRef refColorKey As UInteger,
<OutAttribute> ByRef refAlpha As Byte,
<OutAttribute> ByRef flags As LayeredWindowAttributesFlags
) As Boolean
Dim hWnd As SafeHandle
Dim refColorKey As UInteger
Dim refAlpha As Byte
Dim flags As LayeredWindowAttributesFlags
Dim returnValue As Boolean
returnValue = User32.GetLayeredWindowAttributes(hWnd,
refColorKey, refAlpha, flags)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static bool GetLayeredWindowAttributes(
SafeHandle^ hWnd,
[OutAttribute] unsigned int% refColorKey,
[OutAttribute] unsigned char% refAlpha,
[OutAttribute] LayeredWindowAttributesFlags% flags
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member GetLayeredWindowAttributes :
hWnd : SafeHandle *
refColorKey : uint32 byref *
refAlpha : byte byref *
flags : LayeredWindowAttributesFlags byref -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value
.
To get extended error information, call
GetLastWin32Error.