样式优化 bug修改 鼠标中键呼出
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user