Prepare scanner branch for merge
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user