Class Dwm
Dwm Utils class
Inheritance
Namespace: Dapplo.Windows.DesktopWindowsManager
Assembly: Dapplo.Windows.DesktopWindowsManager.dll
Syntax
public static class Dwm : object
Properties
| Improve this Doc View SourceColorizationColor
Return the AERO Color
Declaration
public static Color ColorizationColor { get; }
Property Value
Type | Description |
---|---|
Color |
ColorizationSystemDrawingColor
Return the AERO Color
Declaration
public static System.Drawing.Color ColorizationSystemDrawingColor { get; }
Property Value
Type | Description |
---|---|
System.Drawing.Color |
IsDwmEnabled
Helper method for an easy DWM check
Declaration
public static bool IsDwmEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean | bool true if DWM is available AND active |
Methods
| Improve this Doc View SourceDisableComposition()
Disable composition
Declaration
public static void DisableComposition()
DwmEnableBlurBehindWindow(IntPtr, ref DwmBlurBehind)
See DwmEnableBlurBehindWindow function Enables the blur effect on a specified window.
Declaration
public static HResult DwmEnableBlurBehindWindow(IntPtr hwnd, ref DwmBlurBehind blurBehind)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hwnd | The handle to the window on which the blur behind data is applied. |
DwmBlurBehind | blurBehind | DwmBlurBehind |
Returns
Type | Description |
---|---|
HResult | HResult |
DwmEnableComposition(UInt32)
See DwmEnableComposition function As of Windows 8, calling this function with DWM_EC_DISABLECOMPOSITION has no effect. However, the function will still return a success code.
Declaration
public static HResult DwmEnableComposition(uint uCompositionAction)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | uCompositionAction | DWM_EC_ENABLECOMPOSITION to enable DWM composition; DWM_EC_DISABLECOMPOSITION to disable composition. |
Returns
Type | Description |
---|---|
HResult | HResult |
DwmGetWindowAttribute(IntPtr, DwmWindowAttributes, out RECT, Int32)
See DwmGetWindowAttribute function Retrieves the current value of a specified attribute applied to a window. TODO: Currently only DWMWA_EXTENDED_FRAME_BOUNDS is supported, due to the type of lpRect
Declaration
public static HResult DwmGetWindowAttribute(IntPtr hwnd, DwmWindowAttributes dwAttribute, out RECT lpRect, int size)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hwnd | The handle to the window from which the attribute data is retrieved. |
DwmWindowAttributes | dwAttribute | The attribute to retrieve, specified as a DwmWindowAttributes value. |
RECT | lpRect | A pointer to a value that, when this function returns successfully, receives the current value of the attribute. The type of the retrieved value depends on the value of the dwAttribute parameter. |
System.Int32 | size |
Returns
Type | Description |
---|---|
HResult | The size of the DWMWINDOWATTRIBUTE value being retrieved. The size is dependent on the type of the pvAttribute parameter. |
DwmpStartOrStopFlip3D()
Activate Windows + Tab effect
Declaration
public static bool DwmpStartOrStopFlip3D()
Returns
Type | Description |
---|---|
System.Boolean | bool if it worked |
DwmQueryThumbnailSourceSize(IntPtr, out SIZE)
Retrieves the source size of the Desktop Window Manager (DWM) thumbnail.
Declaration
public static HResult DwmQueryThumbnailSourceSize(IntPtr hThumbnail, out SIZE size)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hThumbnail | A handle to the thumbnail to retrieve the source window size from. |
SIZE | size | a SIZE structure that, when this function returns successfully, receives the size of the source thumbnail. |
Returns
Type | Description |
---|---|
HResult | HResult |
DwmRegisterThumbnail(IntPtr, IntPtr, out IntPtr)
Creates a Desktop Window Manager (DWM) thumbnail relationship between the destination and source windows.
Declaration
public static HResult DwmRegisterThumbnail(IntPtr hwndDestination, IntPtr hwndSource, out IntPtr phThumbnailId)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hwndDestination | The handle to the window that will use the DWM thumbnail. Setting the destination window handle to anything other than a top-level window type will result in a return value of E_INVALIDARG. |
IntPtr | hwndSource | The handle to the window to use as the thumbnail source. Setting the source window handle to anything other than a top-level window type will result in a return value of E_INVALIDARG. |
IntPtr | phThumbnailId | A pointer to a handle that, when this function returns successfully, represents the registration of the DWM thumbnail. |
Returns
Type | Description |
---|---|
HResult | HResult |
DwmSetWindowAttribute(IntPtr, DwmWindowAttributes, IntPtr, UInt32)
Sets the value of non-client rendering attributes for a window. See DwmSetWindowAttribute function
Declaration
public static HResult DwmSetWindowAttribute(IntPtr hwnd, DwmWindowAttributes dwAttributeToSet, IntPtr pvAttributeValue, uint cbAttribute)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hwnd | IntPtr with the handle to the window that will receive the attributes. |
DwmWindowAttributes | dwAttributeToSet | A single DWMWINDOWATTRIBUTE flag to apply to the window. This parameter specifies the attribute and the pvAttribute parameter points to the value of that attribute. |
IntPtr | pvAttributeValue | A pointer to the value of the attribute specified in the dwAttribute parameter. Different DWMWINDOWATTRIBUTE flags require different value types. |
System.UInt32 | cbAttribute | The size, in bytes, of the value type pointed to by the pvAttribute parameter. |
Returns
Type | Description |
---|---|
HResult |
DwmUnregisterThumbnail(IntPtr)
Removes a Desktop Window Manager (DWM) thumbnail relationship created by the DwmRegisterThumbnail function.
Declaration
public static HResult DwmUnregisterThumbnail(IntPtr hThumbnailId)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hThumbnailId | The handle to the thumbnail relationship to be removed. Null or non-existent handles will result in a return value of E_INVALIDARG. |
Returns
Type | Description |
---|---|
HResult | HResult |
DwmUpdateThumbnailProperties(IntPtr, ref DwmThumbnailProperties)
Updates the properties for a Desktop Window Manager (DWM) thumbnail.
Declaration
public static HResult DwmUpdateThumbnailProperties(IntPtr hThumbnailId, ref DwmThumbnailProperties props)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hThumbnailId | IntPtr The handle to the DWM thumbnail to be updated. Null or invalid thumbnails, as well as thumbnails owned by other processes will result in a return value of E_INVALIDARG. |
DwmThumbnailProperties | props | A pointer to a DwmThumbnailProperties structure that contains the new thumbnail properties. |
Returns
Type | Description |
---|---|
HResult | HResult |
EnableComposition()
Enable DWM composition
Declaration
public static void EnableComposition()
GetExtendedFrameBounds(IntPtr, out RECT)
Helper method to get the window size for DWM Windows
Declaration
public static bool GetExtendedFrameBounds(IntPtr hWnd, out RECT rectangle)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hWnd | IntPtr |
RECT | rectangle | out RECT |
Returns
Type | Description |
---|---|
System.Boolean | bool true if it worked |
GetSharedSurface(IntPtr, Int64, UInt32, UInt32, ref UInt32, out IntPtr, UInt64)
Retrieves the shared surface of the specified hWnd, maybe https://github.com/notr1ch/DWMCapture can help on the usage. http://undoc.airesoft.co.uk/user32.dll/DwmGetDxSharedSurface.php?
Declaration
public static int GetSharedSurface(IntPtr hWnd, long adapterLuid, uint one, uint two, ref uint pD3DFormat, out IntPtr pSharedHandle, ulong unknown)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hWnd | IntPtr |
System.Int64 | adapterLuid | |
System.UInt32 | one | |
System.UInt32 | two | |
System.UInt32 | pD3DFormat | |
IntPtr | pSharedHandle | |
System.UInt64 | unknown |
Returns
Type | Description |
---|---|
System.Int32 |
UpdateWindowShared(IntPtr, Int32, Int32, Int32, IntPtr, IntPtr)
maybe https://github.com/notr1ch/DWMCapture can help on the usage.
Declaration
public static int UpdateWindowShared(IntPtr hWnd, int one, int two, int three, IntPtr hMonitor, IntPtr unknown)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hWnd | IntPtr |
System.Int32 | one | |
System.Int32 | two | |
System.Int32 | three | |
IntPtr | hMonitor | |
IntPtr | unknown |
Returns
Type | Description |
---|---|
System.Int32 |