🐛 1修复程序崩溃, :boom:2添加时钟显秒

This commit is contained in:
BookerLiu
2022-07-25 17:57:57 +08:00
parent 6f62e6b2a0
commit a50d88f2c2
23 changed files with 1239 additions and 131 deletions

View File

@@ -142,26 +142,7 @@ 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;
}
/// <summary>
/// 根据路径获取文件图标等信息
@@ -263,21 +244,7 @@ namespace GeekDesk.Util
}
[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();
/// <summary>