diff --git a/GreenshotPlugin/UnmanagedHelpers/DWM.cs b/GreenshotPlugin/UnmanagedHelpers/DWM.cs index 2c2cb8aee..9a355edd1 100644 --- a/GreenshotPlugin/UnmanagedHelpers/DWM.cs +++ b/GreenshotPlugin/UnmanagedHelpers/DWM.cs @@ -102,6 +102,8 @@ namespace GreenshotPlugin.UnmanagedHelpers { public static extern int DwmQueryThumbnailSourceSize(IntPtr thumb, out SIZE size); [DllImport("dwmapi", SetLastError = true)] public static extern int DwmUpdateThumbnailProperties(IntPtr hThumb, ref DWM_THUMBNAIL_PROPERTIES props); + + // Deprecated as of Windows 8 Release Preview [DllImport("dwmapi", SetLastError = true)] public static extern int DwmIsCompositionEnabled(out bool enabled); [DllImport("dwmapi", SetLastError = true)] @@ -109,7 +111,11 @@ namespace GreenshotPlugin.UnmanagedHelpers { [DllImport("dwmapi", SetLastError = true)] public static extern int DwmEnableBlurBehindWindow(IntPtr hwnd, ref DWM_BLURBEHIND blurBehind); - // Key to ColorizationColor for DWM + // Windows 8, e.g.: + //[DllImport("dwmapi", SetLastError = true)] + //public static extern DWMAPI DwmShowContact(DWORD dwPointerID, DWM_SHOWCONTACT eShowContact); + + // Key to ColorizationColor for DWM private const string COLORIZATION_COLOR_KEY = @"SOFTWARE\Microsoft\Windows\DWM"; /// @@ -117,6 +123,12 @@ namespace GreenshotPlugin.UnmanagedHelpers { /// /// bool true if DWM is available AND active public static bool isDWMEnabled() { + // According to: http://technet.microsoft.com/en-us/subscriptions/aa969538%28v=vs.85%29.aspx + // And: http://msdn.microsoft.com/en-us/library/windows/desktop/aa969510%28v=vs.85%29.aspx + // DMW is always enabled on Windows 8! So return true and save a check! ;-) + if (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 2) { + return true; + } if (Environment.OSVersion.Version.Major >= 6) { bool dwmEnabled; DWM.DwmIsCompositionEnabled(out dwmEnabled); diff --git a/GreenshotPlugin/UnmanagedHelpers/Enumerations.cs b/GreenshotPlugin/UnmanagedHelpers/Enumerations.cs index 76d4a8afe..7d55d4a3f 100644 --- a/GreenshotPlugin/UnmanagedHelpers/Enumerations.cs +++ b/GreenshotPlugin/UnmanagedHelpers/Enumerations.cs @@ -631,8 +631,12 @@ namespace GreenshotPlugin.UnmanagedHelpers { DWMWA_FORCE_ICONIC_REPRESENTATION, DWMWA_FLIP3D_POLICY, DWMWA_EXTENDED_FRAME_BOUNDS, // This is the one we need for retrieving the Window size since Windows Vista - DWMWA_HAS_ICONIC_BITMAP, - DWMWA_DISALLOW_PEEK, + DWMWA_HAS_ICONIC_BITMAP, // Since Windows 7 + DWMWA_DISALLOW_PEEK, // Since Windows 7 + DWMWA_EXCLUDED_FROM_PEEK, // Since Windows 7 + DWMWA_CLOAK, // Since Windows 8 + DWMWA_CLOAKED, // Since Windows 8 + DWMWA_FREEZE_REPRESENTATION, // Since Windows 8 DWMWA_LAST }