SetLayeredWindowAttributes function user32

Win32Result<bool> SetLayeredWindowAttributes(
  1. HWND hwnd,
  2. COLORREF crKey,
  3. int bAlpha,
  4. LAYERED_WINDOW_ATTRIBUTES_FLAGS dwFlags,
)

Sets the opacity and transparency color key of a layered window.

To learn more, see learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setlayeredwindowattributes.

Implementation

Win32Result<bool> SetLayeredWindowAttributes(
  HWND hwnd,
  COLORREF crKey,
  int bAlpha,
  LAYERED_WINDOW_ATTRIBUTES_FLAGS dwFlags,
) {
  final result_ = SetLayeredWindowAttributes_Wrapper(
    hwnd,
    crKey,
    bAlpha,
    dwFlags,
  );
  return .new(value: result_.value.i32 != FALSE, error: result_.error);
}