From 93cecc0dfeb55ccb935f35f1e3050a8bca90b823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=2E=E5=96=9C?= <50934714+Hellobaka@users.noreply.github.com> Date: Fri, 6 Oct 2023 20:53:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E9=BC=A0=E6=A0=87=E7=A9=BF=E9=80=8F?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E9=A1=B9=E6=8F=90=E4=BE=9B=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/MainWindow.xaml.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 4dfa6d9..9afd95b 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -792,7 +792,12 @@ namespace VPet_Simulator.Windows m_menu = new ContextMenu(); m_menu.Popup += (x, y) => { GameSavesData.Statistics[(gint)"stat_menu_pop"]++; }; - m_menu.MenuItems.Add(new MenuItem("鼠标穿透".Translate(), (x, y) => { SetTransparentHitThrough(); }) { }); + var hitThrough = new MenuItem("鼠标穿透".Translate(), (x, y) => { SetTransparentHitThrough(); }) + { + Name = "NotifyIcon_HitThrough", + Checked = HitThrough + }; + m_menu.MenuItems.Add(hitThrough); m_menu.MenuItems.Add(new MenuItem("操作教程".Translate(), (x, y) => { if (LocalizeCore.CurrentCulture == "zh-Hans") @@ -1037,6 +1042,7 @@ namespace VPet_Simulator.Windows //uint extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE); //SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT); HitThrough = !HitThrough; + notifyIcon.ContextMenu.MenuItems.Find("NotifyIcon_HitThrough", false).First().Checked = HitThrough; if (HitThrough) { Win32.User32.SetWindowLongPtr(_hwnd, Win32.GetWindowLongFields.GWL_EXSTYLE,