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..8abaaa6e956835c837000e2f95b823842be66566 100644 |
--- a/webrtc/modules/desktop_capture/window_capturer_win.cc |
+++ b/webrtc/modules/desktop_capture/window_capturer_win.cc |
@@ -13,6 +13,7 @@ |
#include <assert.h> |
#include "webrtc/base/scoped_ptr.h" |
+#include "webrtc/base/checks.h" |
#include "webrtc/base/win32.h" |
#include "webrtc/modules/desktop_capture/desktop_frame_win.h" |
#include "webrtc/modules/desktop_capture/win/window_capture_utils.h" |
@@ -22,6 +23,8 @@ namespace webrtc { |
namespace { |
+const int kMaxNameLength = 1024; |
+ |
BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) { |
WindowCapturer::WindowList* list = |
reinterpret_cast<WindowCapturer::WindowList*>(param); |
@@ -59,6 +62,23 @@ BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) { |
if (window.title.empty()) |
return TRUE; |
+ // Filter out windows modern apps' windows that cannot be captured. |
+ // Issue 526883 |
+ // Microsoft introduced modern app which can be used cross the Microsoft's |
+ // platforms (Desktop, mobile phone and etc.) from Win8. |
+ // Microsoft confirmed that those windows cannot be captured. |
+ // Modern app's window class name will be ApplicationFrameWindow |
+ // and/or windows.UI.Core.coreWindow. |
mcasas
2015/10/01 21:59:17
Suggestion of rephrase:
// Windows 8 introduced
gyzhou
2015/10/02 18:30:34
Done.
|
+ if (rtc::IsWindows8OrLater()) { |
+ char class_name[kMaxNameLength]; |
mcasas
2015/10/01 21:59:17
Why not reuse |kClassLength|? (l.43)
gyzhou
2015/10/02 18:30:34
Done.
Since GetClassName() called in lin45. It ma
|
+ int class_name_length = GetClassNameA(hwnd, class_name, kMaxNameLength); |
mcasas
2015/10/01 21:59:17
const
mcasas
2015/10/01 21:59:17
|class_name_length| or |classNameLength| ?
gyzhou
2015/10/02 18:30:35
Done.
gyzhou
2015/10/02 18:30:35
Done.
gyzhou
2015/10/02 18:30:35
class_name_length is consistent with other part of
|
+ RTC_DCHECK(class_name_length) << |
+ "Error retrieving the application's class name"; |
+ if (strcmp(class_name, "ApplicationFrameWindow") == 0 || |
+ strcmp(class_name, "Windows.UI.Core.CoreWindow") == 0) |
+ return TRUE; |
+ } |
+ |
list->push_back(window); |
return TRUE; |