コード例 #1
0
        public static void Kill()
        {
            Instant  startTime = SystemClock.Instance.GetCurrentInstant();
            Duration elapsedTime;
            // ReSharper disable once SuggestVarOrType_SimpleTypes
            IntPtr dialog;

            do
            {
                dialog      = WindowService.FindWindow(AsusErrorMessageClassName, AsusErrorMessageWindowName);
                elapsedTime = SystemClock.Instance.GetCurrentInstant() - startTime;
                Thread.Sleep(TimeSpan.FromMilliseconds(25));
            } while ((elapsedTime < Duration.FromMinutes(5)) && (WindowService.WindowIsPresent(dialog) == false));


            while (WindowService.IsOpen(dialog))
            {
                WindowService.CloseWindow(dialog);
                Thread.Sleep(TimeSpan.FromMilliseconds(25));
            }

            ConfirmedDialogClosedOrNotPresent = true;
        }