From 502fe4427007bd4cc20cc00d3e9d617a02b46ed9 Mon Sep 17 00:00:00 2001 From: RKrom Date: Fri, 23 Nov 2012 23:19:20 +0000 Subject: [PATCH] Don't instantiate the IAppVisibility if < Windows 8, so there is one exception less in the logs. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2307 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotPlugin/Core/WindowsHelper.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GreenshotPlugin/Core/WindowsHelper.cs b/GreenshotPlugin/Core/WindowsHelper.cs index 0605be419..34ea4badb 100644 --- a/GreenshotPlugin/Core/WindowsHelper.cs +++ b/GreenshotPlugin/Core/WindowsHelper.cs @@ -172,7 +172,10 @@ namespace GreenshotPlugin.Core { static WindowDetails() { try { - appVisibility = COMWrapper.CreateInstance(); + // Only try to instanciate when Windows 8 or later. + if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 2) { + appVisibility = COMWrapper.CreateInstance(); + } } catch {} }