Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ private struct MONITORINFO
private const int WS_EX_TRANSPARENT = 0x00000020;
private const int WS_EX_LAYERED = 0x00080000;
private const int WS_EX_TOOLWINDOW = 0x00000080;
private const int WS_EX_NOACTIVATE = 0x08000000;

private const Int32 CURSOR_SHOWING = 0x00000001; // 光标可见状态码
private const int SM_XVIRTUALSCREEN = 76;
Expand Down Expand Up @@ -165,7 +166,7 @@ protected override void OnSourceInitialized(EventArgs e)
base.OnSourceInitialized(e);
_hwnd = new WindowInteropHelper(this).Handle;
int style = GetWindowLong(_hwnd, GWL_EXSTYLE);
SetWindowLong(_hwnd, GWL_EXSTYLE, style | WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_TOOLWINDOW);
SetWindowLong(_hwnd, GWL_EXSTYLE, style | WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE);

UpdateOverlayBounds();
SystemEvents.DisplaySettingsChanged += HandleDisplaySettingsChanged;
Expand Down Expand Up @@ -582,7 +583,7 @@ private void UpdateOverlayBounds()
_virtualScreenLeft,
_virtualScreenTop,
_virtualScreenWidth,
_virtualScreenHeight,
_virtualScreenHeight - 1,
SWP_NOACTIVATE);
}

Expand Down
Loading