How to find window id for recording specific window using Qt on Windows operating system?

345 views Asked by At

How can I create video of specific window on Windows operating system using Qt? Specific window can be any opened GUI program like Chrome, Notepad etc

QScreen *screen = QGuiApplication::primaryScreen();
if (const QWindow *window = windowHandle())
    screen = window->screen();

pixmap = screen->grabWindow(0);

Using this approach by continuously taking screenshot I can record entire desktop but How can I record specific window? For which I need to know window id of that specific window first.

0

There are 0 answers