5#include "private/qcapturablewindow_p.h"
13 return hwnd && ::GetAncestor(hwnd, GA_ROOT) == hwnd;
20 if (!::IsWindowVisible(hwnd))
24 if (!::GetWindowRect(hwnd, &
rect))
37 auto titleLength = ::GetWindowTextLengthW(hwnd);
38 std::wstring
buffer(titleLength + 1, L
'\0');
39 titleLength = ::GetWindowTextW(hwnd,
buffer.data(), titleLength + 1);
40 buffer.resize(titleLength);
47 QList<QCapturableWindow>
result;
49 auto windowHandler = [](HWND hwnd, LPARAM lParam) {
53 auto&
windows = *
reinterpret_cast<QList<QCapturableWindow>*
>(lParam);
55 auto windowData = std::make_unique<QCapturableWindowPrivate>();
58 windows.push_back(windowData.release()->create());
63 ::EnumWindows(windowHandler,
reinterpret_cast<LPARAM
>(&
result));
70 const auto hwnd =
reinterpret_cast<HWND
>(
window.id);
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromStdWString(const std::wstring &s)
Returns a copy of the str string.
bool isWindowValid(const QCapturableWindowPrivate &window) const override
QList< QCapturableWindow > windows() const override
Combined button and popup list for selecting options.
static bool canCaptureWindow(HWND hwnd)
static QT_BEGIN_NAMESPACE bool isTopLevelWindow(HWND hwnd)
static QString windowTitle(HWND hwnd)