Index: webrtc/modules/desktop_capture/window_capturer_win.cc |
diff --git a/webrtc/modules/desktop_capture/window_capturer_win.cc b/webrtc/modules/desktop_capture/window_capturer_win.cc |
index ba45eaa9d18a78d15ee3ed0c6c285e76bf089eb1..ed22917129afe995813aca0b05fb69b4ca3766e1 100644 |
--- a/webrtc/modules/desktop_capture/window_capturer_win.cc |
+++ b/webrtc/modules/desktop_capture/window_capturer_win.cc |
@@ -59,6 +59,23 @@ BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) { |
if (window.title.empty()) |
return TRUE; |
+ // Filter out windows modern apps' windows based on the observation: |
+ // When a modern app's window is in foreground and not minimized : |
+ // class name = ApplicationFrameWindow |
+ // When a modern app's window is in foreground and minimized : |
+ // class name = windows.UI.Core.coreWindow |
+ // when a modern app's window is in background: |
+ // It is listed as two windows with class name = ApplicationFrameWindow |
+ // and class name = windows.UI.Core.coreWindow. |
+ // Webrtc is not able to capture modern apps' windows on 09/30/2015. |
mcasas
2015/10/01 17:19:04
This is a bit too verbose :) Please rephrase more
gyzhou
2015/10/02 18:30:34
Done.
|
+ if (rtc::IsWindows8OrLater()) { |
+ char clsName[1024]; |
mcasas
2015/10/01 17:19:04
This needs to be WCHAR right? Like in l.53.
gyzhou
2015/10/02 18:30:34
GetClassName using WCHAR as input
GetClassNameA ca
|
+ GetClassNameA(hwnd, clsName, 1024); |
mcasas
2015/10/01 17:19:04
What about the return value? and what is 1024?
Su
gyzhou
2015/10/02 18:30:34
Done.
|
+ if (strcmp(clsName, "ApplicationFrameWindow") == 0 || |
+ strcmp(clsName, "Windows.UI.Core.CoreWindow") == 0) |
mcasas
2015/10/01 17:19:04
Nit: I wouldn't use camlcase names ever, but if th
gyzhou
2015/10/02 18:30:34
Done.
|
+ return true; |
+ } |
+ |
list->push_back(window); |
return TRUE; |