Fixes: Catching an outlook exception that can be ignored. Making sure that the window to be captured is active, so the colors are right. Also a little cleanup, and added FindWindow to the User32.cs so we can use this to find Metro (Modern UI) applications, this still needs to be added to the WindowsHelper.cs

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2244 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-11-06 06:11:37 +00:00
commit 15d5bb58e4
3 changed files with 23 additions and 18 deletions

View file

@ -264,9 +264,6 @@ namespace GreenshotPlugin.UnmanagedHelpers {
/// User32 Wrappers
/// </summary>
public class User32 {
public const int WM_COMMAND = 0x111;
public const int WM_SYSCOMMAND = 0x112;
public const int SC_RESTORE = 0xF120;
public const int SC_CLOSE = 0xF060;
public const int SC_MAXIMIZE = 0xF030;
@ -409,7 +406,13 @@ namespace GreenshotPlugin.UnmanagedHelpers {
public static extern IntPtr SetClipboardViewer(IntPtr hWndNewViewer);
[DllImport("user32", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool ChangeClipboardChain(IntPtr hWndRemove, IntPtr hWndNewNext);
// Added for finding Metro apps
[DllImport("user32", SetLastError = true)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32", SetLastError = true)]
public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
/// uiFlags: 0 - Count of GDI objects
/// uiFlags: 1 - Count of USER objects
/// - Win32 GDI objects (pens, brushes, fonts, palettes, regions, device contexts, bitmap headers)