Prepare scanner branch for merge

This commit is contained in:
AzuTear
2026-07-09 08:44:50 +02:00
parent f791d1464c
commit 8b73c01e46
69 changed files with 6700 additions and 3773 deletions
+4 -4
View File
@@ -104,7 +104,7 @@ internal static class Program
case "click":
{
var info = FocusGenshinWindow();
var info = FocusGenshinWindow(includeProcessNames: false);
if (info.Focused && !info.AlreadyForeground) Thread.Sleep(120);
var targetX = GetInt(root, "x");
@@ -283,14 +283,14 @@ internal static class Program
return new CursorState { X = pt.X, Y = pt.Y, Escape = esc, Enter = enter, F9 = f9 };
}
private static FocusInfo FocusGenshinWindow()
private static FocusInfo FocusGenshinWindow(bool includeProcessNames = true)
{
var hwnd = FindGenshinWindow();
var info = new FocusInfo
{
Hwnd = hwnd,
ForegroundProcess = "",
TargetProcess = ProcessNameFromHwnd(hwnd),
TargetProcess = includeProcessNames ? ProcessNameFromHwnd(hwnd) : "",
};
if (hwnd == IntPtr.Zero) return info;
@@ -303,7 +303,7 @@ internal static class Program
var foreground = Native.GetForegroundWindow();
info.Focused = foreground == hwnd;
info.ForegroundProcess = ProcessNameFromHwnd(foreground);
info.ForegroundProcess = includeProcessNames ? ProcessNameFromHwnd(foreground) : "";
return info;
}