Skip to content

Commit b17ed9c

Browse files
2.1.8.0 "The handle is invalid" is no longer logged as an error when Windows is locked at the time a screenshot is taken.
1 parent 822d33f commit b17ed9c

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.1.7.9")]
36-
[assembly: AssemblyFileVersion("2.1.7.9")]
35+
[assembly: AssemblyVersion("2.1.8.0")]
36+
[assembly: AssemblyFileVersion("2.1.8.0")]
3737
[assembly: NeutralResourcesLanguageAttribute("en-CA")]

ScreenCapture.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,12 @@ public static Bitmap GetScreenBitmap(int x, int y, int width, int height, int ra
172172
}
173173
catch (Exception ex)
174174
{
175-
Log.Write("ScreenCapture::GetScreenBitmap(x, y, width, height, ratio, format, mouse)", ex);
175+
// Don't log an error if Windows is locked at the time a screenshot was taken.
176+
if (!ex.Message.Equals("The handle is invalid"))
177+
{
178+
Log.Write("ScreenCapture::GetScreenBitmap(x, y, width, height, ratio, format, mouse)", ex);
179+
}
180+
176181
return null;
177182
}
178183
}

app.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<assemblyIdentity
44
type="win32"
55
name="GavinKendall.AutoScreenCapture"
6-
version="2.1.7.9"/>
6+
version="2.1.8.0"/>
77
<asmv3:application>
88
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
99
<dpiAware>True/PM</dpiAware>

settings/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace AutoScreenCapture
77
public static class Settings
88
{
99
public static readonly string ApplicationName = "Auto Screen Capture";
10-
public static readonly string ApplicationVersion = "2.1.7.9";
10+
public static readonly string ApplicationVersion = "2.1.8.0";
1111

1212
public static SettingCollection Application;
1313
public static SettingCollection User;

0 commit comments

Comments
 (0)