changed window name of the OBS window to "OBS"

"Advanced Scene Switcher" didn't make sense for the whole of OBS
This commit is contained in:
WarmUpTill 2017-11-29 21:21:25 +01:00 committed by GitHub
parent 12512f7d0a
commit c606869d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,14 +61,19 @@ void GetWindowList(vector<string>& windows)
void GetCurrentWindowTitle(string& title)
{
HWND window = GetForegroundWindow();
DWORD id;
GetWindowThreadProcessId(window, &id);
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.*/
if (id == GetCurrentProcessId()) {
title = "";
DWORD this_thid = GetCurrentThreadId();
//wstring message = L"\nUI id " + to_wstring(thid) + L", this_th_id " + to_wstring(this_thid) + L"\n";
//OutputDebugString(message.c_str());
//if (this_thid == thid) {
if (GetCurrentProcessId() == pid) {
title = "OBS";
return;
}
GetWindowTitle(window, title);