• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.Windows.App
    • AppQuery
  • Dapplo.Windows.Citrix
    • WinFrame
  • Dapplo.Windows.Citrix.Enums
    • ConnectStates
    • EventMask
    • InfoClasses
  • Dapplo.Windows.Citrix.Structs
    • ClientAddress
    • ClientDisplay
  • Dapplo.Windows.Clipboard
    • ClipboardMonitor
    • ClipboardNative
    • ClipboardUpdateInformation
    • StandardClipboardFormats
  • Dapplo.Windows.Com
    • ComProgIdAttribute
    • ComWrapper
    • DisposableCom
    • IDispatch
    • IDisposableCom<T>
    • IOleCommandTarget
    • IOleWindow
    • IUnknown
  • Dapplo.Windows.Common
    • Win32
    • WindowsVersion
  • Dapplo.Windows.Common.Enums
    • AdjacentTo
    • HResult
    • Win32Error
  • Dapplo.Windows.Common.Extensions
    • HResultExtensions
    • RectExensions
  • Dapplo.Windows.Common.Structs
    • POINT
    • RECT
    • RECTF
    • SIZE
  • Dapplo.Windows.Desktop
    • EnvironmentChangedEventArgs
    • EnvironmentMonitor
    • IInteropWindow
    • InteropWindow
    • InteropWindowExtensions
    • InteropWindowFactory
    • InteropWindowQuery
    • WindowScroller
    • WindowsEnumerator
    • WinEventHook
  • Dapplo.Windows.DesktopWindowsManager
    • Dwm
    • DwmBlurBehind
    • DwmBlurBehindFlags
    • DwmSetIconicLivePreviewFlags
    • DwmThumbnailProperties
    • DwmThumbnailPropertyFlags
    • DwmWindowAttributes
  • Dapplo.Windows.Dpi
    • BitmapScaleHandler
    • BitmapScaleHandler<TKey>
    • DpiAwareness
    • DpiAwarenessContext
    • DpiHandler
    • WinProcListener
  • Dapplo.Windows.Dpi.Enums
    • MonitorDpiType
  • Dapplo.Windows.Dpi.Forms
    • DpiAwareForm
    • FormsExtensions
  • Dapplo.Windows.Dpi.Wpf
    • WindowExtensions
  • Dapplo.Windows.Enums
    • InteropWindowCacheFlags
    • WinEventHookFlags
    • WinEvents
  • Dapplo.Windows.Gdi32
    • Gdi32Api
    • GdiExtensions
    • GdiPlusApi
  • Dapplo.Windows.Gdi32.Enums
    • BitmapCompressionMethods
    • ColorSpaceEnum
    • DeviceCaps
    • GdiPlusStatus
    • GpUnit
    • RasterOperations
  • Dapplo.Windows.Gdi32.SafeHandles
    • SafeCompatibleDcHandle
    • SafeDcHandle
    • SafeDeviceContextHandle
    • SafeDibSectionHandle
    • SafeHBitmapHandle
    • SafeObjectHandle
    • SafeRegionHandle
    • SafeSelectObjectHandle
    • SafeWindowDcHandle
  • Dapplo.Windows.Gdi32.Structs
    • BitfieldColorMask
    • BitmapFileHeader
    • BitmapInfoHeader
    • BlurParams
    • CieXyz
    • CieXyzTripple
  • Dapplo.Windows.Input
    • Hotkey
    • InputGenerator
    • KeyboardHook
    • KeyboardHookEventArgs
    • MouseHook
    • MouseHookEventArgs
  • Dapplo.Windows.Input.Enums
    • ExtendedKeyFlags
    • ExtendedMouseFlags
    • HookTypes
    • InputTypes
    • KeyEventFlags
    • MouseEventFlags
    • ScanCodes
    • VirtualKeyCodes
  • Dapplo.Windows.Input.Structs
    • HardwareInput
    • Input
    • InputUnion
    • KeyboardInput
    • KeyboardLowLevelHookStruct
    • MouseInput
    • MouseLowLevelHookStruct
  • Dapplo.Windows.Interop
    • DisposableCom
    • IDisposableCom<T>
  • Dapplo.Windows.Kernel32
    • Kernel32Api
    • PsApi
  • Dapplo.Windows.Kernel32.Enums
    • GlobalMemorySettings
    • ProcessAccessRights
    • ThreadAccess
    • WindowsProducts
    • WindowsProductTypes
    • WindowsSuites
  • Dapplo.Windows.Kernel32.Structs
    • OsVersionInfoEx
  • Dapplo.Windows.Messages
    • WindowsMessage
    • WindowsMessages
    • WinProcHandler
  • Dapplo.Windows.Multimedia
    • SoundSettings
    • SystemSounds
    • WinMm
  • Dapplo.Windows.Native
    • Shell32
    • Shell32.FolderType
    • Shell32.IconSize
  • Dapplo.Windows.Shell32
    • Shell32Api
  • Dapplo.Windows.Shell32.Enums
    • AppBarEdges
    • AppBarMessages
    • AppBarStates
  • Dapplo.Windows.Shell32.Structs
    • AppBarData
  • Dapplo.Windows.Structs
    • WinEventInfo
  • Dapplo.Windows.User32
    • User32Api
    • User32Api.EnumWindowsProc
  • Dapplo.Windows.User32.Enums
    • ClassLongIndex
    • CursorInfoFlags
    • DesktopAccessRight
    • ExtendedWindowStyleFlags
    • GetWindowCommands
    • MonitorFrom
    • MonitorInfoFlags
    • ObjectIdentifiers
    • ObjectStates
    • PrintWindowFlags
    • RegionResults
    • ScrollBarCommands
    • ScrollBarStateIndexes
    • ScrollBarTypes
    • ScrollInfoMask
    • ScrollModes
    • SendMessageTimeoutFlags
    • ShowWindowCommands
    • SysCommands
    • SystemMetric
    • SystemParametersInfoActions
    • SystemParametersInfoBehaviors
    • TitleBarInfoIndexes
    • WindowLongIndex
    • WindowPlacementFlags
    • WindowPos
    • WindowStyleFlags
  • Dapplo.Windows.User32.SafeHandles
    • SafeCurrentInputDesktopHandle
    • SafeIconHandle
  • Dapplo.Windows.User32.Structs
    • AnimationInfo
    • CursorInfo
    • DisplayInfo
    • IconInfo
    • MonitorInfoEx
    • ScrollBarInfo
    • ScrollInfo
    • TitleBarInfoEx
    • WindowInfo
    • WindowPlacement

Class Dwm

Dwm Utils class

Inheritance
System.Object
Dwm
Namespace: Dapplo.Windows.DesktopWindowsManager
Assembly: Dapplo.Windows.DesktopWindowsManager.dll
Syntax
public static class Dwm : object

Properties

| Improve this Doc View Source

ColorizationColor

Return the AERO Color

Declaration
public static Color ColorizationColor { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

ColorizationSystemDrawingColor

Return the AERO Color

Declaration
public static System.Drawing.Color ColorizationSystemDrawingColor { get; }
Property Value
Type Description
System.Drawing.Color
| Improve this Doc View Source

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 Source

DisableComposition()

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

| Improve this Doc View Source

EnableComposition()

Enable DWM composition

Declaration
public static void EnableComposition()
| Improve this Doc View Source

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
  • Improve this Doc
  • View Source
Back to top Copyright © 2017 Dapplo