样式优化 bug修改 鼠标中键呼出

This commit is contained in:
liufei
2021-12-10 17:58:23 +08:00
parent 1c486a5c8a
commit 24ba279b18
41 changed files with 877 additions and 451 deletions

View File

@@ -2,6 +2,7 @@
using GeekDesk.ViewModel;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Serialization.Formatters.Binary;
using System.Windows;
@@ -52,7 +53,46 @@ namespace GeekDesk.Util
}
}
/// <summary>
/// 判断当前屏幕(鼠标最后活动屏幕)是否有全屏化应用
/// </summary>
/// <returns></returns>
public static bool IsPrimaryFullScreen()
{
RECT rect = new RECT();
GetWindowRect(new HandleRef(null, GetForegroundWindow()), ref rect);
int windowHeight = rect.bottom - rect.top;
int screenHeight = (int)SystemParameters.PrimaryScreenHeight;
if (windowHeight >= screenHeight)
{
return true;
}
return false;
}
[StructLayout(LayoutKind.Sequential)]
private struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
[DllImport("user32.dll")]
private static extern bool GetWindowRect(HandleRef hWnd, [In, Out] ref RECT rect);
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
}