mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
为鼠标穿透菜单项提供选中状态 by Hellobaka
为鼠标穿透菜单项提供选中状态
This commit is contained in:
commit
9125b55cc3
@ -792,7 +792,12 @@ namespace VPet_Simulator.Windows
|
|||||||
|
|
||||||
m_menu = new ContextMenu();
|
m_menu = new ContextMenu();
|
||||||
m_menu.Popup += (x, y) => { GameSavesData.Statistics[(gint)"stat_menu_pop"]++; };
|
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) =>
|
m_menu.MenuItems.Add(new MenuItem("操作教程".Translate(), (x, y) =>
|
||||||
{
|
{
|
||||||
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
||||||
@ -1037,6 +1042,7 @@ namespace VPet_Simulator.Windows
|
|||||||
//uint extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
|
//uint extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||||
//SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
|
//SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
|
||||||
HitThrough = !HitThrough;
|
HitThrough = !HitThrough;
|
||||||
|
notifyIcon.ContextMenu.MenuItems.Find("NotifyIcon_HitThrough", false).First().Checked = HitThrough;
|
||||||
if (HitThrough)
|
if (HitThrough)
|
||||||
{
|
{
|
||||||
Win32.User32.SetWindowLongPtr(_hwnd, Win32.GetWindowLongFields.GWL_EXSTYLE,
|
Win32.User32.SetWindowLongPtr(_hwnd, Win32.GetWindowLongFields.GWL_EXSTYLE,
|
||||||
|
Loading…
Reference in New Issue
Block a user