1 /* 2 * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef MODULES_DESKTOP_CAPTURE_WIN_SELECTED_WINDOW_CONTEXT_H_ 12 #define MODULES_DESKTOP_CAPTURE_WIN_SELECTED_WINDOW_CONTEXT_H_ 13 14 #include <windows.h> 15 16 #include "modules/desktop_capture/desktop_geometry.h" 17 #include "modules/desktop_capture/win/window_capture_utils.h" 18 19 namespace webrtc { 20 21 class SelectedWindowContext { 22 public: 23 SelectedWindowContext(HWND selected_window, 24 DesktopRect selected_window_rect, 25 WindowCaptureHelperWin* window_capture_helper); 26 27 bool IsSelectedWindowValid() const; 28 29 bool IsWindowOwnedBySelectedWindow(HWND hwnd) const; 30 bool IsWindowOverlappingSelectedWindow(HWND hwnd) const; 31 32 HWND selected_window() const; 33 WindowCaptureHelperWin* window_capture_helper() const; 34 35 private: 36 const HWND selected_window_; 37 const DesktopRect selected_window_rect_; 38 WindowCaptureHelperWin* const window_capture_helper_; 39 DWORD selected_window_thread_id_; 40 DWORD selected_window_process_id_; 41 }; 42 43 } // namespace webrtc 44 45 #endif // MODULES_DESKTOP_CAPTURE_WIN_SELECTED_WINDOW_CONTEXT_H_ 46