diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/Launching/Handler/LaunchExecutionBetterGenshinImpactAutomationHandlder.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/Launching/Handler/LaunchExecutionBetterGenshinImpactAutomationHandlder.cs index 79803342..a800e661 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Game/Launching/Handler/LaunchExecutionBetterGenshinImpactAutomationHandlder.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/Launching/Handler/LaunchExecutionBetterGenshinImpactAutomationHandlder.cs @@ -26,11 +26,16 @@ internal sealed class LaunchExecutionBetterGenshinImpactAutomationHandlder : ILa try { context.Logger.LogInformation("Waiting game window to be ready"); - context.Process.WaitForInputIdle(); + + SpinWait spinWait = default; + while (context.Process.MainWindowHandle == IntPtr.Zero) + { + spinWait.SpinOnce(); + } } catch (InvalidOperationException) { - context.Logger.LogInformation("Failed to wait Input idle waiting"); + context.Logger.LogInformation("Failed to get game window handle"); return; }