Reputation: 77
I want to get all opened non qt window from qt application and display them , i get all opened window but i can't display their names or positions.
this->_WindowsList = QGuiApplication::allWindows(); // i get all windows
for (uint i = 0 ; i< _WindowsList.size() ; i++)
{
this->ui->listWidget->addItem(_WindowsList.at(i)->title()); // no name are displayed just rows
}
Upvotes: 2
Views: 4001
Reputation: 730
There is no "universal Qt way" of enumerating all the active windows opened in your environment. There are different ways of doing this on different platforms/environments - your best bet is detecting the host operating system via QSysInfo()
and then using OS specific code.
Here are some basic examples:
EnumWindows()
on Microsoft Windows via the WinAPIUpvotes: 3