selected_window_context.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #ifndef MODULES_DESKTOP_CAPTURE_WIN_SELECTED_WINDOW_CONTEXT_H_
  11. #define MODULES_DESKTOP_CAPTURE_WIN_SELECTED_WINDOW_CONTEXT_H_
  12. #include <windows.h>
  13. #include "modules/desktop_capture/desktop_geometry.h"
  14. #include "modules/desktop_capture/win/window_capture_utils.h"
  15. namespace webrtc {
  16. class SelectedWindowContext {
  17. public:
  18. SelectedWindowContext(HWND selected_window,
  19. DesktopRect selected_window_rect,
  20. WindowCaptureHelperWin* window_capture_helper);
  21. bool IsSelectedWindowValid() const;
  22. bool IsWindowOwnedBySelectedWindow(HWND hwnd) const;
  23. bool IsWindowOverlappingSelectedWindow(HWND hwnd) const;
  24. HWND selected_window() const;
  25. WindowCaptureHelperWin* window_capture_helper() const;
  26. private:
  27. const HWND selected_window_;
  28. const DesktopRect selected_window_rect_;
  29. WindowCaptureHelperWin* const window_capture_helper_;
  30. DWORD selected_window_thread_id_;
  31. DWORD selected_window_process_id_;
  32. };
  33. } // namespace webrtc
  34. #endif // MODULES_DESKTOP_CAPTURE_WIN_SELECTED_WINDOW_CONTEXT_H_