Table of Contents

Class UnsafeNativeMethods

Namespace
Wpf.Ui.Interop
Assembly
Wpf.Ui.dll

A set of dangerous methods to modify the appearance.

public static class UnsafeNativeMethods
Inheritance
UnsafeNativeMethods
Inherited Members

Methods

ApplyWindowBackdrop(IntPtr, WindowBackdropType)

Tries to apply selected backdrop type for window handle.

public static bool ApplyWindowBackdrop(IntPtr handle, WindowBackdropType backgroundType)

Parameters

handle IntPtr

Selected window handle.

backgroundType WindowBackdropType

Backdrop type.

Returns

bool

true if invocation of native Windows function succeeds.

ApplyWindowCornerPreference(IntPtr, WindowCornerPreference)

Tries to set the corner preference of the selected window.

public static bool ApplyWindowCornerPreference(IntPtr handle, WindowCornerPreference cornerPreference)

Parameters

handle IntPtr

Selected window handle.

cornerPreference WindowCornerPreference

Window corner preference.

Returns

bool

true if invocation of native Windows function succeeds.

ApplyWindowCornerPreference(Window, WindowCornerPreference)

Tries to set the Window corner preference.

public static bool ApplyWindowCornerPreference(Window window, WindowCornerPreference cornerPreference)

Parameters

window Window

Selected window.

cornerPreference WindowCornerPreference

Window corner preference.

Returns

bool

true if invocation of native Windows function succeeds.

ApplyWindowDarkMode(IntPtr)

Tries to apply ImmersiveDarkMode effect for the window handle.

public static bool ApplyWindowDarkMode(IntPtr handle)

Parameters

handle IntPtr

Window handle.

Returns

bool

true if invocation of native Windows function succeeds.

ApplyWindowDarkMode(Window?)

Tries to apply ImmersiveDarkMode effect for the Window.

public static bool ApplyWindowDarkMode(Window? window)

Parameters

window Window

The window to which the effect is to be applied.

Returns

bool

true if invocation of native Windows function succeeds.

ApplyWindowLegacyAcrylicEffect(IntPtr)

Tries to apply legacy Acrylic effect for the selected Window.

public static bool ApplyWindowLegacyAcrylicEffect(IntPtr handle)

Parameters

handle IntPtr

Window handle

Returns

bool

true if invocation of native Windows function succeeds.

ApplyWindowLegacyAcrylicEffect(Window?)

Tries to apply legacy Acrylic effect for the selected Window.

public static bool ApplyWindowLegacyAcrylicEffect(Window? window)

Parameters

window Window

The window to which the effect is to be applied.

Returns

bool

true if invocation of native Windows function succeeds.

ApplyWindowLegacyMicaEffect(IntPtr)

Tries to apply legacy Mica effect for the selected Window.

public static bool ApplyWindowLegacyMicaEffect(IntPtr handle)

Parameters

handle IntPtr

Window handle.

Returns

bool

true if invocation of native Windows function succeeds.

ApplyWindowLegacyMicaEffect(Window?)

Tries to apply legacy Mica effect for the selected Window.

public static bool ApplyWindowLegacyMicaEffect(Window? window)

Parameters

window Window

The window to which the effect is to be applied.

Returns

bool

true if invocation of native Windows function succeeds.

ExtendClientAreaIntoTitleBar(IntPtr)

public static bool ExtendClientAreaIntoTitleBar(IntPtr hWnd)

Parameters

hWnd IntPtr

Returns

bool

ExtendClientAreaIntoTitleBar(Window)

public static bool ExtendClientAreaIntoTitleBar(Window window)

Parameters

window Window

Returns

bool

GetDwmColor()

Tries to get currently selected Window accent color.

public static Color GetDwmColor()

Returns

Color

IsCompositionEnabled()

Checks whether the DWM composition is enabled.

public static bool IsCompositionEnabled()

Returns

bool

IsValidWindow(IntPtr)

Checks if provided pointer represents existing window.

public static bool IsValidWindow(IntPtr hWnd)

Parameters

hWnd IntPtr

Returns

bool

IsWindowHasBackdrop(IntPtr, WindowBackdropType)

Tries to determine whether the provided Window has applied legacy backdrop effect.

public static bool IsWindowHasBackdrop(IntPtr handle, WindowBackdropType backdropType)

Parameters

handle IntPtr

Window handle.

backdropType WindowBackdropType

Background backdrop type.

Returns

bool

IsWindowHasLegacyMica(IntPtr)

Tries to determine whether the provided handle has applied legacy Mica effect.

public static bool IsWindowHasLegacyMica(IntPtr handle)

Parameters

handle IntPtr

Window handle.

Returns

bool

IsWindowHasLegacyMica(Window?)

Tries to determine whether the provided Window has applied legacy Mica effect.

public static bool IsWindowHasLegacyMica(Window? window)

Parameters

window Window

Window to check.

Returns

bool

RemoveWindowCaption(IntPtr)

public static bool RemoveWindowCaption(IntPtr hWnd)

Parameters

hWnd IntPtr

Returns

bool

RemoveWindowCaption(Window)

public static bool RemoveWindowCaption(Window window)

Parameters

window Window

Returns

bool

RemoveWindowDarkMode(IntPtr)

Tries to remove ImmersiveDarkMode effect from the window handle.

public static bool RemoveWindowDarkMode(IntPtr handle)

Parameters

handle IntPtr

Window handle.

Returns

bool

true if invocation of native Windows function succeeds.

RemoveWindowDarkMode(Window?)

Tries to remove ImmersiveDarkMode effect from the Window.

public static bool RemoveWindowDarkMode(Window? window)

Parameters

window Window

The window to which the effect is to be applied.

Returns

bool

true if invocation of native Windows function succeeds.

RemoveWindowTitlebarContents(IntPtr)

Tries to remove titlebar from selected window handle.

public static bool RemoveWindowTitlebarContents(IntPtr handle)

Parameters

handle IntPtr

Window handle.

Returns

bool

true if invocation of native Windows function succeeds.

RemoveWindowTitlebarContents(Window?)

Tries to remove titlebar from selected Window.

public static bool RemoveWindowTitlebarContents(Window? window)

Parameters

window Window

The window to which the effect is to be applied.

Returns

bool

true if invocation of native Windows function succeeds.