From 192cec68c7bb1a3a363a0d833d7b289f40859d32 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Thu, 24 Jul 2025 23:18:44 +0800 Subject: [PATCH 01/12] =?UTF-8?q?improve:=E8=87=AA=E5=8A=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/Helpers/AutoUpdateHelper.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Ink Canvas/Helpers/AutoUpdateHelper.cs b/Ink Canvas/Helpers/AutoUpdateHelper.cs index 8aa47c2b..c01e4dd4 100644 --- a/Ink Canvas/Helpers/AutoUpdateHelper.cs +++ b/Ink Canvas/Helpers/AutoUpdateHelper.cs @@ -845,9 +845,31 @@ namespace Ink_Canvas.Helpers } } progressCallback?.Invoke(100, $"多线程下载完成({threadCount}线程)"); + + FileInfo fileInfo = new FileInfo(destinationPath); + if (fileInfo.Length != totalSize) + { + LogHelper.WriteLogToFile($"AutoUpdate | 文件大小校验失败,本地:{fileInfo.Length},服务器:{totalSize}", LogHelper.LogType.Error); + File.Delete(destinationPath); + progressCallback?.Invoke(0, "文件大小校验失败,已删除损坏文件"); + return false; + } + if (destinationPath.EndsWith(".zip", StringComparison.OrdinalIgnoreCase)) + { + try + { + System.IO.Compression.ZipFile.OpenRead(destinationPath).Dispose(); + } + catch + { + LogHelper.WriteLogToFile("AutoUpdate | ZIP文件解压测试失败,文件可能已损坏", LogHelper.LogType.Error); + File.Delete(destinationPath); + progressCallback?.Invoke(0, "ZIP文件解压测试失败,已删除损坏文件"); + return false; + } + } return true; } - // 理论上不会到这里 return false; } From 19b1c7ae8bb7bac0fc925c8db942093d4961d58c Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 09:58:53 +0800 Subject: [PATCH 02/12] =?UTF-8?q?improve:PPT=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow_cs/MW_PPT.cs | 82 +++++++++++++----------------- 1 file changed, 35 insertions(+), 47 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs index 85e7aa30..a5051eef 100644 --- a/Ink Canvas/MainWindow_cs/MW_PPT.cs +++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs @@ -1579,6 +1579,7 @@ namespace Ink_Canvas { public bool IsMaximized { get; set; } public ForegroundWindowInfo.RECT Rect { get; set; } public uint ProcessId { get; set; } + public string ProcessName { get; set; } // 新增 } /// @@ -1656,6 +1657,15 @@ namespace Ink_Canvas { GetWindowThreadProcessId(hWnd, out processId); windowInfo.ProcessId = processId; + // 新增:获取进程名 + windowInfo.ProcessName = ""; + try + { + var proc = System.Diagnostics.Process.GetProcessById((int)processId); + windowInfo.ProcessName = proc.ProcessName.ToLower(); + } + catch { } + return windowInfo; } @@ -1667,58 +1677,30 @@ namespace Ink_Canvas { if (string.IsNullOrEmpty(windowInfo.Title) && string.IsNullOrEmpty(windowInfo.ClassName)) return false; - // 检查窗口标题 var title = windowInfo.Title.ToLower(); var className = windowInfo.ClassName.ToLower(); + var processName = windowInfo.ProcessName ?? ""; - // WPS相关关键词(扩展版) - var wpsKeywords = new[] - { - "wps", "演示文稿", "presentation", "powerpoint", "ppt", "pptx", - "kingsoft", "金山", "office", "幻灯片", "slide", "presentation", - "wpp", "wps演示", "wps presentation", "wps office", "kingsoft office" - }; + // WPS相关关键词 + var wpsKeywords = new[] { "wps", "wpp", "kingsoft", "金山", "wps演示", "wps presentation", "wps office", "kingsoft office" }; + // 微软Office相关进程名 + var msOfficeProcess = new[] { "powerpnt", "excel", "word", "onenote", "outlook", "microsoftoffice", "office" }; - // 检查标题是否包含WPS相关关键词 + // 只要进程名是微软Office,直接排除 + if (msOfficeProcess.Any(keyword => processName.Contains(keyword))) + return false; + + // 只要进程名是WPS/WPP/Kingsoft,直接通过 + if (wpsKeywords.Any(keyword => processName.Contains(keyword))) + return true; + + // 标题或类名包含WPS相关关键词 bool hasWpsTitle = wpsKeywords.Any(keyword => title.Contains(keyword)); - - // 检查类名是否包含WPS相关关键词 bool hasWpsClass = wpsKeywords.Any(keyword => className.Contains(keyword)); + bool isWpsClass = className.Contains("wps") || className.Contains("kingsoft") || className.Contains("wpp"); + bool hasValidSize = (windowInfo.Rect.Right - windowInfo.Rect.Left) > 0 && (windowInfo.Rect.Bottom - windowInfo.Rect.Top) > 0; - // 检查是否为WPS特有的窗口类名 - bool isWpsClass = className.Contains("wps") || - className.Contains("kingsoft") || - className.Contains("presentation") || - className.Contains("powerpoint") || - className.Contains("wpp") || - className.Contains("office"); - - // 检查窗口是否有有效尺寸(排除0尺寸窗口) - bool hasValidSize = (windowInfo.Rect.Right - windowInfo.Rect.Left) > 0 && - (windowInfo.Rect.Bottom - windowInfo.Rect.Top) > 0; - - // 检查窗口是否可见且不是最小化状态 - bool isActiveWindow = windowInfo.IsVisible && !windowInfo.IsMinimized; - - // 检查是否为前台窗口 - bool isForegroundWindow = windowInfo.Handle == GetForegroundWindow(); - - // 综合判断是否为WPS窗口 - bool isWpsWindow = (hasWpsTitle || hasWpsClass || isWpsClass) && hasValidSize; - - // 如果是前台窗口且包含相关关键词,更可能是WPS窗口 - if (isForegroundWindow && (hasWpsTitle || hasWpsClass)) - { - isWpsWindow = true; - } - - if (isWpsWindow) - { - var windowType = isForegroundWindow ? "前台" : (isActiveWindow ? "活跃" : "后台"); - LogHelper.WriteLogToFile($"确认WPS窗口: 标题='{windowInfo.Title}', 类名='{windowInfo.ClassName}', 类型={windowType}, 尺寸={windowInfo.Rect.Right - windowInfo.Rect.Left}x{windowInfo.Rect.Bottom - windowInfo.Rect.Top}", LogHelper.LogType.Trace); - } - - return isWpsWindow; + return (hasWpsTitle || hasWpsClass || isWpsClass) && hasValidSize; } /// @@ -1954,9 +1936,15 @@ namespace Ink_Canvas { try { var pname = process.ProcessName.ToLower(); + // 只允许WPS/WPP相关进程,排除PowerPoint及微软Office if ((pname.Contains("wps") || pname.Contains("wpp") || pname.Contains("presentation")) - // 排除PowerPoint官方进程 - && !pname.Contains("powerpnt")) + && !pname.Contains("powerpnt") + && !pname.Contains("office") + && !pname.Contains("onenote") + && !pname.Contains("excel") + && !pname.Contains("word") + && !pname.Contains("outlook") + && !pname.Contains("microsoft")) { wpsProcesses.Add(process); LogHelper.WriteLogToFile($"发现WPS进程: {process.ProcessName} (PID: {process.Id})", LogHelper.LogType.Trace); From a7b861f83c5d73423c722c3038d3e9c48299899b Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 10:21:55 +0800 Subject: [PATCH 03/12] =?UTF-8?q?improve:PPT=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow_cs/MW_PPT.cs | 37 ++++++++++++------ ...vasForClass.csproj.AssemblyReference.cache | Bin 35374 -> 35237 bytes 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs index a5051eef..4db96d73 100644 --- a/Ink Canvas/MainWindow_cs/MW_PPT.cs +++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs @@ -81,6 +81,9 @@ namespace Ink_Canvas { // 在类中添加字段 private bool wasFloatingBarFoldedWhenEnterSlideShow = false; + // 新增:用于控制WPS强制关闭提示只弹一次 + private static bool hasShownWpsForceCloseWarning = false; + private void BtnCheckPPT_Click(object sender, RoutedEventArgs e) { try { pptApplication = @@ -1473,20 +1476,29 @@ namespace Ink_Canvas { if (!allSaved) { - // 弹窗提示用户 - bool userContinue = false; - Application.Current.Dispatcher.Invoke(() => + // 弹窗提示用户(只弹一次) + if (!hasShownWpsForceCloseWarning) { - var result = MessageBox.Show( - "检测到有未保存的WPS文档,强制关闭可能导致数据丢失。是否继续?", - "警告", MessageBoxButton.YesNo, MessageBoxImage.Warning); - userContinue = (result == MessageBoxResult.Yes); - }); - if (!userContinue) + hasShownWpsForceCloseWarning = true; + bool userContinue = false; + Application.Current.Dispatcher.Invoke(() => + { + var result = MessageBox.Show( + "检测到有未保存的WPS文档,强制关闭可能导致数据丢失。是否继续?", + "警告", MessageBoxButton.YesNo, MessageBoxImage.Warning); + userContinue = (result == MessageBoxResult.Yes); + }); + if (!userContinue) + { + LogHelper.WriteLogToFile("用户取消了强制关闭WPS进程", LogHelper.LogType.Trace); + StopWppProcessCheckTimer(); + return; + } + } + else { - LogHelper.WriteLogToFile("用户取消了强制关闭WPS进程", LogHelper.LogType.Trace); - StopWppProcessCheckTimer(); - return; + // 已弹过,直接跳过或默认继续 + LogHelper.WriteLogToFile("WPS强制关闭提示已弹出,自动继续。", LogHelper.LogType.Trace); } } @@ -1531,6 +1543,7 @@ namespace Ink_Canvas { } finally { + hasShownWpsForceCloseWarning = false; // 复位,便于下次检测 StopWppProcessCheckTimer(); } } diff --git a/Ink Canvas/obj/Debug/net472/InkCanvasForClass.csproj.AssemblyReference.cache b/Ink Canvas/obj/Debug/net472/InkCanvasForClass.csproj.AssemblyReference.cache index 4af914e22079d93b58f0e03491291464a0dba41e..007dd88682c1e146a5e6a6e4853914122d4656c7 100644 GIT binary patch delta 23 ecmZ2Cg=y(zCJr`6T?PgQ#>B~j@}V1JJvsqL(gqX& delta 70 zcmZ2FnQ7e=CJr`6Jq88_#>B~j@}V1JJvt{RD27kAm*kqv$IYhXte29L!^j9!!0^EF X#&?CQ93Zt^WhQzCdd3FEhL#KfgtieT From db582f6c8866b5fab8085ebf6fe679e26b4bc726 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 11:07:12 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/AssemblyInfo.cs | 4 ++-- Ink Canvas/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Ink Canvas/AssemblyInfo.cs b/Ink Canvas/AssemblyInfo.cs index 23fa0df7..8434eb71 100644 --- a/Ink Canvas/AssemblyInfo.cs +++ b/Ink Canvas/AssemblyInfo.cs @@ -49,5 +49,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.7.1.14")] -[assembly: AssemblyFileVersion("1.7.1.14")] +[assembly: AssemblyVersion("1.7.2.0")] +[assembly: AssemblyFileVersion("1.7.2.0")] diff --git a/Ink Canvas/Properties/AssemblyInfo.cs b/Ink Canvas/Properties/AssemblyInfo.cs index 156b074e..d5760b20 100644 --- a/Ink Canvas/Properties/AssemblyInfo.cs +++ b/Ink Canvas/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.7.1.14")] -[assembly: AssemblyFileVersion("1.7.1.14")] +[assembly: AssemblyVersion("1.7.2.0")] +[assembly: AssemblyFileVersion("1.7.2.0")] From 8c657a4ccfe5c764327b1f5c51581e2131f31434 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 17:50:07 +0800 Subject: [PATCH 05/12] =?UTF-8?q?improve:PPT=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow_cs/MW_PPT.cs | 27 ++----------------- .../InkCanvasForClass_MarkupCompile.cache | 2 +- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs index 4db96d73..4bb128d2 100644 --- a/Ink Canvas/MainWindow_cs/MW_PPT.cs +++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs @@ -1476,30 +1476,8 @@ namespace Ink_Canvas { if (!allSaved) { - // 弹窗提示用户(只弹一次) - if (!hasShownWpsForceCloseWarning) - { - hasShownWpsForceCloseWarning = true; - bool userContinue = false; - Application.Current.Dispatcher.Invoke(() => - { - var result = MessageBox.Show( - "检测到有未保存的WPS文档,强制关闭可能导致数据丢失。是否继续?", - "警告", MessageBoxButton.YesNo, MessageBoxImage.Warning); - userContinue = (result == MessageBoxResult.Yes); - }); - if (!userContinue) - { - LogHelper.WriteLogToFile("用户取消了强制关闭WPS进程", LogHelper.LogType.Trace); - StopWppProcessCheckTimer(); - return; - } - } - else - { - // 已弹过,直接跳过或默认继续 - LogHelper.WriteLogToFile("WPS强制关闭提示已弹出,自动继续。", LogHelper.LogType.Trace); - } + // 直接跳过弹窗,自动继续 + LogHelper.WriteLogToFile("检测到有未保存的WPS文档,但已取消弹窗提示,自动继续。", LogHelper.LogType.Trace); } // 立即结束WPP进程 @@ -1543,7 +1521,6 @@ namespace Ink_Canvas { } finally { - hasShownWpsForceCloseWarning = false; // 复位,便于下次检测 StopWppProcessCheckTimer(); } } diff --git a/Ink Canvas/obj/Debug/net472/InkCanvasForClass_MarkupCompile.cache b/Ink Canvas/obj/Debug/net472/InkCanvasForClass_MarkupCompile.cache index 9faa8f50..3b245387 100644 --- a/Ink Canvas/obj/Debug/net472/InkCanvasForClass_MarkupCompile.cache +++ b/Ink Canvas/obj/Debug/net472/InkCanvasForClass_MarkupCompile.cache @@ -16,5 +16,5 @@ E:\ICC CE\ICC CE main\community\Ink Canvas\App.xaml 471037513499 Helpers\Plugins\BuiltIn\SuperLauncher\LauncherSettingsControl.xaml;Helpers\Plugins\BuiltIn\SuperLauncher\LauncherWindow.xaml;MainWindow.xaml;MainWindow_cs\MW_Eraser.xaml;Resources\DrawShapeImageDictionary.xaml;Resources\IconImageDictionary.xaml;Resources\SeewoImageDictionary.xaml;Resources\Styles\Dark.xaml;Resources\Styles\Light.xaml;Windows\AddCustomIconWindow.xaml;Windows\AddPickNameBackgroundWindow.xaml;Windows\CountdownTimerWindow.xaml;Windows\CustomIconWindow.xaml;Windows\CycleProcessBar.xaml;Windows\HasNewUpdateWindow.xaml;Windows\HistoryRollbackWindow.xaml;Windows\ManagePickNameBackgroundsWindow.xaml;Windows\NamesInputWindow.xaml;Windows\OperatingGuideWindow.xaml;Windows\PluginSettingsWindow.xaml;Windows\RandWindow.xaml;Windows\YesOrNoNotificationWindow.xaml; -False +True From 4efd6abb5697974ba11769a2fd5112991382c75e Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 17:57:04 +0800 Subject: [PATCH 06/12] =?UTF-8?q?improve:=E4=BB=BB=E5=8A=A1=E6=A0=8F?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/Helpers/ForegroundWindowInfo.cs | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/Ink Canvas/Helpers/ForegroundWindowInfo.cs b/Ink Canvas/Helpers/ForegroundWindowInfo.cs index cd6d3c17..7968fc49 100644 --- a/Ink Canvas/Helpers/ForegroundWindowInfo.cs +++ b/Ink Canvas/Helpers/ForegroundWindowInfo.cs @@ -2,8 +2,6 @@ using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; -using System.Windows.Forms; -using System.Drawing; namespace Ink_Canvas.Helpers { @@ -95,23 +93,5 @@ namespace Ink_Canvas.Helpers return "Unknown"; } } - - public static int GetTaskbarHeight(Screen screen, double dpiScaleY) - { - // 优先用工作区和屏幕区的差值法,兼容多屏 - int height = 0; - if (screen.Bounds.Height > screen.WorkingArea.Height) - { - // 任务栏在上下 - height = screen.Bounds.Height - screen.WorkingArea.Height; - } - else if (screen.Bounds.Width > screen.WorkingArea.Width) - { - // 任务栏在左右 - height = screen.Bounds.Width - screen.WorkingArea.Width; - } - // 考虑DPI缩放 - return (int)(height / dpiScaleY); - } } } \ No newline at end of file From 616df56657769051fa768838b8b6bb7b3295a2fc Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 18:02:46 +0800 Subject: [PATCH 07/12] =?UTF-8?q?improve:=E4=BB=BB=E5=8A=A1=E6=A0=8F?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/Helpers/ForegroundWindowInfo.cs | 10 ++++++++++ ...vasForClass.csproj.AssemblyReference.cache | Bin 35237 -> 35374 bytes .../InkCanvasForClass_MarkupCompile.cache | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Ink Canvas/Helpers/ForegroundWindowInfo.cs b/Ink Canvas/Helpers/ForegroundWindowInfo.cs index 7968fc49..b1100993 100644 --- a/Ink Canvas/Helpers/ForegroundWindowInfo.cs +++ b/Ink Canvas/Helpers/ForegroundWindowInfo.cs @@ -93,5 +93,15 @@ namespace Ink_Canvas.Helpers return "Unknown"; } } + + public static double GetTaskbarHeight(System.Windows.Forms.Screen screen, double dpiScaleY) + { + // 获取工作区和屏幕高度的差值 + var workingArea = screen.WorkingArea; + var bounds = screen.Bounds; + int taskbarHeight = bounds.Height - workingArea.Height; + // 考虑 DPI 缩放 + return taskbarHeight / dpiScaleY; + } } } \ No newline at end of file diff --git a/Ink Canvas/obj/Debug/net472/InkCanvasForClass.csproj.AssemblyReference.cache b/Ink Canvas/obj/Debug/net472/InkCanvasForClass.csproj.AssemblyReference.cache index 007dd88682c1e146a5e6a6e4853914122d4656c7..4af914e22079d93b58f0e03491291464a0dba41e 100644 GIT binary patch delta 70 zcmZ2FnQ7e=CJr`6Jq88_#>B~j@}V1JJvt{RD27kAm*kqv$IYhXte29L!^j9!!0^EF X#&?CQ93Zt^WhQzCdd3FEhL#KfgtieT delta 23 ecmZ2Cg=y(zCJr`6T?PgQ#>B~j@}V1JJvsqL(gqX& diff --git a/Ink Canvas/obj/Debug/net472/InkCanvasForClass_MarkupCompile.cache b/Ink Canvas/obj/Debug/net472/InkCanvasForClass_MarkupCompile.cache index 3b245387..9faa8f50 100644 --- a/Ink Canvas/obj/Debug/net472/InkCanvasForClass_MarkupCompile.cache +++ b/Ink Canvas/obj/Debug/net472/InkCanvasForClass_MarkupCompile.cache @@ -16,5 +16,5 @@ E:\ICC CE\ICC CE main\community\Ink Canvas\App.xaml 471037513499 Helpers\Plugins\BuiltIn\SuperLauncher\LauncherSettingsControl.xaml;Helpers\Plugins\BuiltIn\SuperLauncher\LauncherWindow.xaml;MainWindow.xaml;MainWindow_cs\MW_Eraser.xaml;Resources\DrawShapeImageDictionary.xaml;Resources\IconImageDictionary.xaml;Resources\SeewoImageDictionary.xaml;Resources\Styles\Dark.xaml;Resources\Styles\Light.xaml;Windows\AddCustomIconWindow.xaml;Windows\AddPickNameBackgroundWindow.xaml;Windows\CountdownTimerWindow.xaml;Windows\CustomIconWindow.xaml;Windows\CycleProcessBar.xaml;Windows\HasNewUpdateWindow.xaml;Windows\HistoryRollbackWindow.xaml;Windows\ManagePickNameBackgroundsWindow.xaml;Windows\NamesInputWindow.xaml;Windows\OperatingGuideWindow.xaml;Windows\PluginSettingsWindow.xaml;Windows\RandWindow.xaml;Windows\YesOrNoNotificationWindow.xaml; -True +False From 624af87795bd4806ca84f996308478d8cfc4189e Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 18:12:46 +0800 Subject: [PATCH 08/12] =?UTF-8?q?fix:=E4=BE=A7=E8=BE=B9=E6=A0=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8F=8A=E6=B5=AE=E5=8A=A8=E6=A0=8F=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow.xaml.cs | 46 ++--------------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index 23b5565d..a6979eb6 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -28,44 +28,7 @@ namespace Ink_Canvas { private System.Windows.Controls.Canvas currentCanvas = null; private AutoUpdateHelper.UpdateLineGroup AvailableLatestLineGroup = null; - // Win32 API声明和常量(用于无焦点窗口) - [DllImport("user32.dll")] - private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); - [DllImport("user32.dll")] - private static extern int GetWindowLong(IntPtr hWnd, int nIndex); - private const int GWL_EXSTYLE = -20; - private const int WS_EX_NOACTIVATE = 0x08000000; - [DllImport("user32.dll")] - private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); - private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1); - private static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2); - private const uint SWP_NOSIZE = 0x0001; - private const uint SWP_NOMOVE = 0x0002; - private const uint SWP_NOACTIVATE = 0x0010; - private const uint SWP_SHOWWINDOW = 0x0040; - - // 新增:设置窗口置顶并兼容无焦点 - private void SetTopmostWithNoActivate(bool topmost) - { - var hwnd = new WindowInteropHelper(this).Handle; - int exStyle = GetWindowLong(hwnd, GWL_EXSTYLE); - // 先移除 WS_EX_NOACTIVATE - SetWindowLong(hwnd, GWL_EXSTYLE, exStyle & ~WS_EX_NOACTIVATE); - // 设置 Topmost - this.Topmost = topmost; - // 使用SetWindowPos确保无焦点置顶 - if (topmost) - { - SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW); - } - else - { - SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW); - } - // 再加回 WS_EX_NOACTIVATE - exStyle = GetWindowLong(hwnd, GWL_EXSTYLE); - SetWindowLong(hwnd, GWL_EXSTYLE, exStyle | WS_EX_NOACTIVATE); - } + #region Window Initialization @@ -206,12 +169,7 @@ namespace Ink_Canvas { }; } - protected override void OnSourceInitialized(EventArgs e) - { - base.OnSourceInitialized(e); - // 设置窗口为无焦点且置顶(不会抢占焦点且始终在最前) - SetTopmostWithNoActivate(true); - } + #endregion From bcd0509eff4904812c4ea88547c7743ed68cad58 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 18:21:16 +0800 Subject: [PATCH 09/12] =?UTF-8?q?improve:=E7=AA=97=E5=8F=A3=E6=97=A0?= =?UTF-8?q?=E7=84=A6=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow.xaml | 7 ++++++ Ink Canvas/MainWindow.xaml.cs | 37 ++++++++++++++++++++++++++++++++ Ink Canvas/Resources/Settings.cs | 3 +++ 3 files changed, 47 insertions(+) diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml index 17ed7835..81ddbb30 100644 --- a/Ink Canvas/MainWindow.xaml +++ b/Ink Canvas/MainWindow.xaml @@ -618,6 +618,13 @@ FontSize="26" /> + + + + Date: Fri, 25 Jul 2025 18:28:38 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutomaticUpdateVersionControl.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomaticUpdateVersionControl.txt b/AutomaticUpdateVersionControl.txt index af307083..a8f0717b 100644 --- a/AutomaticUpdateVersionControl.txt +++ b/AutomaticUpdateVersionControl.txt @@ -1 +1 @@ -1.7.1.0 +1.7.2.0 From 7f1f322d0491e9783e2ee6afab148b9fb6d110b9 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 18:32:03 +0800 Subject: [PATCH 11/12] =?UTF-8?q?improve:=E7=99=BD=E6=9D=BF=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow_cs/MW_Timer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_Timer.cs b/Ink Canvas/MainWindow_cs/MW_Timer.cs index 30436a85..8545c44a 100644 --- a/Ink Canvas/MainWindow_cs/MW_Timer.cs +++ b/Ink Canvas/MainWindow_cs/MW_Timer.cs @@ -105,8 +105,8 @@ namespace Ink_Canvas { timerDisplayDate.Interval = 1000 * 60 * 60 * 1; timerDisplayDate.Start(); timerKillProcess.Start(); - nowTimeVM.nowDate = DateTime.Now.ToShortDateString().ToString(); - nowTimeVM.nowTime = DateTime.Now.ToShortTimeString().ToString(); + nowTimeVM.nowDate = DateTime.Now.ToString("yyyy/M/d"); + nowTimeVM.nowTime = DateTime.Now.ToString("HH:mm"); } private async Task TimerDisplayTime_ElapsedAsync() @@ -115,12 +115,12 @@ namespace Ink_Canvas { // 只更新时间,日期由原有逻辑定时更新即可 Dispatcher.Invoke(() => { - nowTimeVM.nowTime = now.ToShortTimeString(); + nowTimeVM.nowTime = now.ToString("HH:mm"); }); } private void TimerDisplayDate_Elapsed(object sender, ElapsedEventArgs e) { - nowTimeVM.nowDate = DateTime.Now.ToShortDateString().ToString(); + nowTimeVM.nowDate = DateTime.Now.ToString("yyyy/M/d"); } private void TimerKillProcess_Elapsed(object sender, ElapsedEventArgs e) { From a0058c104de6ac1406316e66adca46a84a845813 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 25 Jul 2025 18:36:23 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UpdateLog.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/UpdateLog.md b/UpdateLog.md index 2e6e94e4..5a0bb6a1 100644 --- a/UpdateLog.md +++ b/UpdateLog.md @@ -1 +1,31 @@ -1. 更新了自动更新 +1. 改进端点吸附 +2. 新增自定义浮动栏图标 +3. 新增自定义点名背景 +4. 新增退出收纳模式自动进入批注选项 +5. 改进自动更新 +6. 改进进程检测 +7. 改进设置侧边栏 +8. 修复PPT联动模块 +9. 修复使用正方形预设时多出来一条直线 +10. 新增白板自定义调色盘 +11. 改进手掌擦逻辑 +12. 新增并改进了插件功能 +13. 修复大量触摸问题 +14. 改进橡皮 +15. 新增设置配置备份功能 +16. 新增墨迹全屏保存功能 +17. 修复win7下的自动更新不可用的问题 +18. 改进墨迹打开功能 +19. 改进插件功能及启动台插件 +20. 改进墨迹平滑方案 +21. 改进窗口无焦点 +22. 修复白板页面预览不可触摸的问题 +23. 新增插入图片功能 +24. 新增侧边栏退出放映按钮 +25. 新增退出PPT自动恢复收纳模式 +26. 新增PPT自动回到首页 +27. 新增查杀鸿合屏幕书写后进入批注 +28. 修复浮动栏高度计算 +29. 修复墨迹错页 +30. 改进直线拉直 +31. 改进白板时间显示