Fixed an issue with finding the GreenshotOCRCommand when running inside Visual Studio.

Fixed an issue with running on Windows 7, as it was trying to access a Windows 10 API
This commit is contained in:
Krom, Robertus 2020-02-18 13:38:52 +01:00
parent 4a958be8b5
commit 3ebdf3d2fe
2 changed files with 4 additions and 5 deletions

View file

@ -8,4 +8,7 @@
<ItemGroup>
<Reference Include="CustomMarshalers" />
</ItemGroup>
<Target Name="PostBuild" BeforeTargets="PostBuildEvent" Condition="'$(BuildingInsideVisualStudio)' == 'true'">
<Exec Command="xcopy /q /y /d &quot;$(TargetDir)*.exe&quot; &quot;$(SolutionDir)$(SolutionName)\$(OutDir)&quot;" />
</Target>
</Project>

View file

@ -2,13 +2,9 @@
using GreenshotPlugin.UnmanagedHelpers;
using log4net;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace GreenshotPlugin.Core
{
@ -28,7 +24,7 @@ namespace GreenshotPlugin.Core
/// <summary>
/// Retrieve the current DPI for the UI element which is related to this DpiHandler
/// </summary>
public static uint Dpi { get; private set; } = GetDpiForSystem();
public static uint Dpi { get; private set; } = WindowsVersion.IsWindows10OrLater ? GetDpiForSystem() : DefaultScreenDpi;
/// <summary>
/// Calculate a DPI scale factor