Changes for Thomas & fixed undo/redo for background changes

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1647 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-02-09 15:30:27 +00:00
commit 46758d238c
8 changed files with 164 additions and 31 deletions

View file

@ -20,6 +20,8 @@
*/
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.Drawing;
namespace GreenshotPlugin.UnmanagedHelpers {
@ -107,6 +109,9 @@ namespace GreenshotPlugin.UnmanagedHelpers {
[DllImport("dwmapi", SetLastError = true)]
public static extern int DwmEnableBlurBehindWindow(IntPtr hwnd, ref DWM_BLURBEHIND blurBehind);
// Key to ColorizationColor for DWM
private const string COLORIZATION_COLOR_KEY = @"SOFTWARE\Microsoft\Windows\DWM";
/// <summary>
/// Helper method for an easy DWM check
/// </summary>
@ -119,5 +124,19 @@ namespace GreenshotPlugin.UnmanagedHelpers {
}
return false;
}
public static Color ColorizationColor {
get {
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(COLORIZATION_COLOR_KEY, false)) {
if (key != null) {
object dwordValue = key.GetValue("ColorizationColor");
if (dwordValue != null) {
return Color.FromArgb((Int32)dwordValue);
}
}
}
return Color.White;
}
}
}
}