win-capture: Ignore cloaked windows
Fixes issue where there are two window handles for minimized Calculator, and OBS picks the wrong one.
This commit is contained in:
parent
a4c9554739
commit
e933e20b7c
@ -32,6 +32,7 @@ add_library(win-capture MODULE
|
||||
${win-capture_HEADERS})
|
||||
target_link_libraries(win-capture
|
||||
libobs
|
||||
Dwmapi
|
||||
ipc-util
|
||||
psapi)
|
||||
|
||||
|
@ -2,8 +2,9 @@
|
||||
#include <obs.h>
|
||||
#include <util/dstr.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <dwmapi.h>
|
||||
#include <psapi.h>
|
||||
#include <windows.h>
|
||||
#include "window-helpers.h"
|
||||
#include "obfuscate.h"
|
||||
|
||||
@ -442,6 +443,12 @@ BOOL CALLBACK enum_windows_proc(HWND window, LPARAM lParam)
|
||||
if (!check_window_valid(window, data->mode))
|
||||
return TRUE;
|
||||
|
||||
int cloaked;
|
||||
if (SUCCEEDED(DwmGetWindowAttribute(window, DWMWA_CLOAKED, &cloaked,
|
||||
sizeof(cloaked))) &&
|
||||
cloaked)
|
||||
return TRUE;
|
||||
|
||||
const int rating = window_rating(window, data->priority, data->class,
|
||||
data->title, data->exe,
|
||||
data->uwp_window);
|
||||
|
Loading…
x
Reference in New Issue
Block a user