Fixed DWM capture for Metro (Modern UI) Apps by not placing it in the foreground.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2248 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-11-08 07:03:53 +00:00
commit 180cc1c661

View file

@ -865,8 +865,10 @@ namespace GreenshotPlugin.Core {
tempForm.BackColor = Color.Black;
// Make sure everything is visible
tempForm.Refresh();
// Make sure the application window is active, so the colors & buttons are right
ToForeground();
if (!isMetroApp) {
// Make sure the application window is active, so the colors & buttons are right
ToForeground();
}
// Make sure all changes are processed and visisble
Application.DoEvents();
using (Bitmap blackBitmap = WindowCapture.CaptureRectangle(captureRectangle)) {
@ -895,8 +897,10 @@ namespace GreenshotPlugin.Core {
}
// Make sure everything is visible
tempForm.Refresh();
// Make sure the application window is active, so the colors & buttons are right
ToForeground();
if (!isMetroApp) {
// Make sure the application window is active, so the colors & buttons are right
ToForeground();
}
// Make sure all changes are processed and visisble
Application.DoEvents();
// Capture from the screen