2021-07-04 01:41:15 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using Sheng.Winform.Controls.Win32;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Sheng.Winform.Controls.Kernal
|
|
|
|
|
|
{
|
2021-07-29 09:09:27 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
2021-07-04 01:41:15 +00:00
|
|
|
|
public static class EnvironmentHelper
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否支持 Windows Vista 以上的玻璃效果
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static bool SupportAreo
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Environment.OSVersion.Version.Major < 6)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否打开了玻璃效果
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static bool DwmIsCompositionEnabled
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return DwmApi.DwmIsCompositionEnabled();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取应用程序主窗体
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static System.Windows.Forms.Form MainForm
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
set;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|