如何停止启用 Windows 10 功能 "focus assist"?

How to stop Windows 10 feature "focus assist" from being enabled?

我正在使用 C# WinForms 创建叠加层。叠加层需要与当前屏幕大小相同(或更大)。但是,它不需要启用 "focus assist" 功能。

我已经尝试使用 FormWindowState.Maximized 和 P/Invoke MoveWindow,但是只要表单的大小与屏幕大小相同(或大于),焦点辅助就会启用。

这是我目前的代码:

叠加表单构造函数

this.DoubleBuffered = true;
this.SetStyle(ControlStyles.OptimizedDoubleBuffer |
    ControlStyles.DoubleBuffer |
    ControlStyles.UserPaint |
    ControlStyles.AllPaintingInWmPaint |
    ControlStyles.SupportsTransparentBackColor, true);

SetWindowLong(this.Handle, GWL_EXSTYLE, (IntPtr)(GetWindowLong(this.Handle, GWL_EXSTYLE) | WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_NOACTIVATE));
SetLayeredWindowAttributes(this.Handle, 0, 128, LWA_ALPHA);
this.TopMost = true;
this.WindowState = FormWindowState.Maximized;

移动窗口

Screen screen = Screen.FromPoint(Cursor.Position);
MoveWindow(this.Handle, screen.Bounds.X, screen.Bounds.Y, screen.Bounds.Width, screen.Bounds.Height, true);

如果有任何方法可以禁用此功能,我还没有找到它。任何想法将不胜感激。

目前无法以编程方式打开/关闭 Focus Assist。

有一些 hacks,但我不推荐使用它们。