mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-25 07:19:39 -05:00
add 'OBS' entry to GetWindowList() on Windows(#76)
This commit is contained in:
parent
4af7540497
commit
b54506c5ee
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user