🚑 修复可能导致输入法特定场景卡顿的问题
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
using GeekDesk.Constant;
|
||||
using GeekDesk.MyThread;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
//using ShowSeconds;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Management;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
@@ -112,5 +118,80 @@ namespace GeekDesk.Control.UserControls.Config
|
||||
{
|
||||
CommonCode.BakAppData();
|
||||
}
|
||||
|
||||
private void ShowSeconds_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//if (MainWindow.appData.AppConfig.SecondsWindow == true)
|
||||
//{
|
||||
// //StartSecondsWindow();
|
||||
// //SecondsWindow.ShowWindow();
|
||||
// MouseHookThread.Dispose();
|
||||
// MouseHookThread.Hook();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// MouseHookThread.Dispose();
|
||||
// MouseHookThread.Hook();
|
||||
//}
|
||||
|
||||
MouseHookThread.Dispose();
|
||||
MouseHookThread.Hook();
|
||||
}
|
||||
|
||||
public static void StopSecondsWindow()
|
||||
{
|
||||
if (MessageUtil.CheckWindowIsRuning("ShowSeconds_Main_" + Constants.MY_UUID))
|
||||
{
|
||||
MessageUtil.SendMsgByWName(
|
||||
"ShowSeconds_Main_" + Constants.MY_UUID,
|
||||
"Shutdown"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//public static void StartSecondsWindow()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// using (var objOS = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"))
|
||||
// {
|
||||
// foreach (ManagementObject objMgmt in objOS.Get())
|
||||
// {
|
||||
// if (objMgmt.Properties["Caption"].Value != null)
|
||||
// {
|
||||
// string caption = objMgmt.Properties["Caption"].Value.ToString(); ;
|
||||
// LogUtil.WriteLog("获取的系统版本号为:" + caption);
|
||||
// if (caption.Contains("Windows 11"))
|
||||
// {
|
||||
// //找到ShowSeconds插件
|
||||
// FileInfo fi = FileUtil.GetFileByNameWithDir("ShowSeconds.exe", Constants.PLUGINS_PATH);
|
||||
// if (fi == null)
|
||||
// {
|
||||
// HandyControl.Controls.MessageBox.Show("未安装程序插件:ShowSeconds");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //检查是否在运行
|
||||
// if (!MessageUtil.CheckWindowIsRuning("ShowSeconds_Main_" + Constants.MY_UUID))
|
||||
// {
|
||||
// using (Process p = new Process())
|
||||
// {
|
||||
// p.StartInfo.FileName = fi.FullName;
|
||||
// p.StartInfo.WorkingDirectory = fi.FullName.Substring(0, fi.FullName.LastIndexOf("\\"));
|
||||
// p.Start();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex) { }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user