Windows 10 maximized window region fix

This commit is contained in:
Jaex 2015-07-21 01:44:03 +03:00
parent 295b15db7e
commit 5fb48cc552
3 changed files with 9 additions and 6 deletions

View file

@ -282,7 +282,7 @@ public static Point ProportionalPosition(Point pos, Point pos2)
return newPosition;
}
public static Rectangle GetWindowRectangle(IntPtr handle, bool maximizeFix = true)
public static Rectangle GetWindowRectangle(IntPtr handle)
{
Rectangle rect = Rectangle.Empty;
@ -301,7 +301,7 @@ public static Rectangle GetWindowRectangle(IntPtr handle, bool maximizeFix = tru
rect = NativeMethods.GetWindowRect(handle);
}
if (maximizeFix && NativeMethods.IsZoomed(handle))
if (!Helpers.IsWindows10OrGreater() && NativeMethods.IsZoomed(handle))
{
rect = NativeMethods.MaximizedWindowFix(handle, rect);
}

View file

@ -442,6 +442,11 @@ public static bool IsWindows8OrGreater()
return (OSVersion.Major == 6 && OSVersion.Minor >= 2) || OSVersion.Major > 6;
}
public static bool IsWindows10OrGreater()
{
return OSVersion.Major >= 10;
}
public static bool IsDefaultInstallDir()
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

View file

@ -749,10 +749,8 @@
<None Include="Favicons\Up1.ico" />
</ItemGroup>
<ItemGroup>
<Content Include="Favicons\CoinURL.ico" />
<Content Include="Favicons\LnkU.ico" />
<None Include="Resources\favicon.ico" />
<None Include="Resources\LnkU.ico" />
<None Include="Favicons\CoinURL.ico" />
<None Include="Favicons\LnkU.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />