ACAT.Extensions.Default.FunctionalAgents.NewFile.NewFileAgent.waitForProcessAndActivate C# (CSharp) Méthode

waitForProcessAndActivate() private méthode

Waits for the process to start and activates the window
private waitForProcessAndActivate ( Process process ) : void
process System.Diagnostics.Process process to activate
Résultat void
        private void waitForProcessAndActivate(Process process)
        {
            try
            {
                process.WaitForInputIdle(6000);
                int ii = 0;
                while (true)
                {
                    IntPtr handle = process.MainWindowHandle;
                    if (handle != IntPtr.Zero)
                    {
                        activateWindow(handle);
                        break;
                    }

                    Thread.Sleep(500);
                    ii++;
                    if (ii > 10)
                    {
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
            }
        }