add 'OBS' entry to GetWindowList() on Windows(#76)

This commit is contained in:
WarmUpTill
2020-11-28 16:23:17 +01:00
committed by GitHub
parent 4af7540497
commit b54506c5ee

View File

@@ -89,6 +89,9 @@ void GetWindowList(QStringList &windows)
for (auto window : w) {
windows << QString::fromStdString(window);
}
// Add entry for OBS Studio itself, see GetCurrentWindowTitle
windows << QString("OBS");
}
void GetCurrentWindowTitle(std::string &title)
@@ -97,10 +100,10 @@ void GetCurrentWindowTitle(std::string &title)
DWORD pid;
DWORD thid;
thid = GetWindowThreadProcessId(window, &pid);
/*GetWindowText will freeze if the control it is reading was created in another thread.
It does not directly read the control.Instead,
it waits for the thread that created the control to process a WM_GETTEXT message.
So if that thread is frozen in a WaitFor... call you have a deadlock.*/
// GetWindowText will freeze if the control it is reading was created in another thread.
// It does not directly read the control.
// Instead it waits for the thread that created the control to process a WM_GETTEXT message.
// So if that thread is frozen in a WaitFor... call you have a deadlock.
if (GetCurrentProcessId() == pid) {
title = "OBS";
return;