Do check if GamePadUI window starts with SP

This commit is contained in:
Kamil Trzciński 2022-12-16 14:16:31 +01:00
parent f1278dbb49
commit b0277d3c0b

View file

@ -74,10 +74,15 @@ namespace SteamController.Helpers
StringBuilder className = new StringBuilder(256);
if (GetClassName(hWnd, className, className.Capacity) == 0)
return false;
if (className.ToString() != "SDL_app")
return false;
StringBuilder windowText = new StringBuilder(256);
if (GetWindowText(hWnd, windowText, windowText.Capacity) == 0)
return false;
if (!windowText.ToString().StartsWith("SP"))
return false;
return ForegroundProcess.Find(hWnd)?.ProcessName == "steamwebhelper";
}
}