Skip to content

Commit f8cb190

Browse files
committed
优化 窗口过滤逻辑
1 parent e932ccc commit f8cb190

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Core.Window/ScreenCapture/ScreenCaptureByWGC.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,12 @@ public List<WindowInfo> GetAllWindowInfo()
7777
{
7878
continue;
7979
}
80-
int style1= User32.GetWindowLong(currentHwnd,User32.WindowLongFlags.GWL_STYLE);
81-
if ( (style1 & (uint) User32.WindowStyles.WS_POPUP) != 0)
80+
int style2 = User32.GetWindowLong(currentHwnd,User32.WindowLongFlags.GWL_EXSTYLE);
81+
if ( (style2 & (int) User32.WindowStylesEx.WS_EX_NOACTIVATE) != 0)
8282
{
8383
continue;
8484
}
85-
int style2 = User32.GetWindowLong(currentHwnd,User32.WindowLongFlags.GWL_EXSTYLE);
86-
if ( (style2 & (int) User32.WindowStylesEx.WS_EX_NOACTIVATE) != 0)
85+
if ( (style2 & WS_EX_TOOLWINDOW) != 0)
8786
{
8887
continue;
8988
}

0 commit comments

Comments
 (0)