39 auto titleLength = ::GetWindowTextLengthW(hwnd);
40 std::wstring buffer(titleLength + 1, L'\0');
41 titleLength = ::GetWindowTextW(hwnd, buffer.data(), titleLength + 1);
42 buffer.resize(titleLength);
44 return QString::fromStdWString(buffer);
47QList<QCapturableWindow> QWinCapturableWindows::windows()
const
49 QList<QCapturableWindow> result;
51 auto windowHandler = [](HWND hwnd, LPARAM lParam) {
52 if (!canCaptureWindow(hwnd))
55 auto& windows = *
reinterpret_cast<QList<QCapturableWindow>*>(lParam);
57 windows.push_back(QCapturableWindowPrivate::create(
58 reinterpret_cast<QCapturableWindowPrivate::Id>(hwnd),
64 ::EnumWindows(windowHandler,
reinterpret_cast<LPARAM>(&result));