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);
47static BOOL CALLBACK windowHandler(HWND hwnd, LPARAM lParam) {
48 if (!canCaptureWindow(hwnd))
51 auto &windows = *
reinterpret_cast<QList<QCapturableWindow> *>(lParam);
53 windows.push_back(QCapturableWindowPrivate::create(
54 reinterpret_cast<QCapturableWindowPrivate::Id>(hwnd),