mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
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:
parent
12512f7d0a
commit
c606869d41
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user