Show / Hide Table of Contents

Class MsWindowExtensions

Contains window management functions via Desktop Window Manager (DWM).

Inheritance
object
MsWindowExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.Windows.dll
Syntax
[ExcludeFromCodeCoverage]
public static class MsWindowExtensions

Methods

| Edit this page View Source

DisableEffects(IMsWindow)

Disables all window effects.

Declaration
public static void DisableEffects(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window instance to blur.

| Edit this page View Source

EnableAcrylic(IMsWindow)

Enables acrylic effects on the window.

Declaration
public static void EnableAcrylic(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window instance in which to activate effects.

| Edit this page View Source

EnableBlur(IMsWindow)

Enables blur effects on the window.

Declaration
public static void EnableBlur(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window instance to blur.

| Edit this page View Source

EnableMicaIfSupported(IMsWindow)

Enables Mica/Acrylic effects on the window.

Declaration
public static void EnableMicaIfSupported(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window instance in which to activate Mica or Acrylic effects.

Remarks

This call will have no effect on Windows 10 16299 and earlier.
On Windows 10 17134 and later, you can use EnableAcrylic(IMsWindow) to enable an equivalent acrylic effect; the resulting window will be drawn with Windows 10 borders, even if the application runs on Windows 11.

| Edit this page View Source

ExtendFrameIntoClientArea(IMsWindow)

Extends the window frame to include the client area.

Declaration
public static void ExtendFrameIntoClientArea(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to extend the frame.

| Edit this page View Source

HideBorder(IMsWindow)

Hides the border of the window.

Declaration
public static void HideBorder(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

HideCaption(IMsWindow)

Hides the caption bar of the window.

Declaration
public static void HideCaption(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

HideClose(IMsWindow)

Disables and hides the window's close button.

Declaration
public static void HideClose(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

HideHelp(IMsWindow)

Disables and hides the help button of the window.

Declaration
public static void HideHelp(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

HideMaximize(IMsWindow)

Disables and hides the maximize button of the window.

Declaration
public static void HideMaximize(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

HideMinimize(IMsWindow)

Disables and hides the minimize button of the window.

Declaration
public static void HideMinimize(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

Move(IMsWindow, Point)

Moves a window using the DWM API.

Declaration
public static void Move(this IMsWindow window, Point newPosition)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

Point newPosition

New position of the window.

| Edit this page View Source

NotifyWindowFrameChange(IMsWindow)

Sends a notification to DWM about a window frame change.

Declaration
public static void NotifyWindowFrameChange(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which the frame change has been made.

| Edit this page View Source

Resize(IMsWindow, Size)

Changes the size of a window using the DWM API.

Declaration
public static void Resize(this IMsWindow window, Size newSize)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

Size newSize

New size of the window.

| Edit this page View Source

SetBackdropType(IMsWindow, SystemBackdropType)

Sets the type of backdrop to draw on the window.

Declaration
[CLSCompliant(false)]
public static void SetBackdropType(this IMsWindow window, SystemBackdropType backdropType)
Parameters
Type Name Description
IMsWindow window

Window instance to modify.

SystemBackdropType backdropType

Type of backdrop to apply.

| Edit this page View Source

SetCaptionColor(IMsWindow, Color)

Sets the window caption color.

Declaration
public static void SetCaptionColor(this IMsWindow window, Color color)
Parameters
Type Name Description
IMsWindow window

Window to set the caption color for.

Color color

Color to apply.

| Edit this page View Source

SetCaptionTextColor(IMsWindow, Color)

Sets the window caption text color.

Declaration
public static void SetCaptionTextColor(this IMsWindow window, Color color)
Parameters
Type Name Description
IMsWindow window

Window to set the caption text color for.

Color color

Color to apply.

| Edit this page View Source

SetClientPadding(IMsWindow, Margins)

Sets an internal margin value for the content of a window.

Declaration
public static void SetClientPadding(this IMsWindow window, Margins padding)
Parameters
Type Name Description
IMsWindow window

Window instance for which to configure the internal frame.

Margins padding

Thickness of the window's internal margins.

| Edit this page View Source

SetCornerPreference(IMsWindow, WindowCornerPreference)

Sets the corner rendering options for the window.

Declaration
[CLSCompliant(false)]
public static void SetCornerPreference(this IMsWindow window, WindowCornerPreference cornerPreference)
Parameters
Type Name Description
IMsWindow window

Window for which to configure the corner rendering options.

WindowCornerPreference cornerPreference

Border configuration to apply.

| Edit this page View Source

SetFramePadding(IMsWindow, Margins)

Sets an internal margin value for the window frame.

Declaration
public static void SetFramePadding(this IMsWindow window, Margins padding)
Parameters
Type Name Description
IMsWindow window

Window instance for which to configure the internal frame.

Margins padding

Thickness of the window's internal margins.

| Edit this page View Source

SetImmersiveDarkMode(IMsWindow, bool)

Enables or disables immersive dark mode for the window.

Declaration
public static void SetImmersiveDarkMode(this IMsWindow window, bool state)
Parameters
Type Name Description
IMsWindow window

Window on which to configure immersive dark mode.

bool state

true to enable immersive dark mode, false to disable.

| Edit this page View Source

SetMica(IMsWindow, bool)

Sets or clears the Mica effect on the window.

Declaration
public static void SetMica(this IMsWindow window, bool state)
Parameters
Type Name Description
IMsWindow window

Window instance to modify.

bool state

true to enable Mica; false to disable it.

Remarks

Available for Windows 11 systems from build 22000 until before 22523. To enable the effect for window backgrounds in Windows 11 22523 and later, use SetBackdropType(IMsWindow, SystemBackdropType).

See Also
SetBackdropType(IMsWindow, SystemBackdropType)
| Edit this page View Source

ShowBorder(IMsWindow)

Shows the border of the window.

Declaration
public static void ShowBorder(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

ShowCaption(IMsWindow)

Shows the caption bar of the window.

Declaration
public static void ShowCaption(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

ShowClose(IMsWindow)

Enables and shows the close button of the window.

Declaration
public static void ShowClose(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

ShowHelp(IMsWindow)

Enables and shows the help button of the window.

Declaration
public static void ShowHelp(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

ShowMaximize(IMsWindow)

Enables and shows the maximize button of the window.

Declaration
public static void ShowMaximize(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

| Edit this page View Source

ShowMinimize(IMsWindow)

Enables and shows the minimize button of the window.

Declaration
public static void ShowMinimize(this IMsWindow window)
Parameters
Type Name Description
IMsWindow window

Window on which to perform the operation.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX