System.Diagnostics.Process.WaitForInputIdle C# (CSharp) Method

WaitForInputIdle() public method

public WaitForInputIdle ( ) : bool
return bool
        public bool WaitForInputIdle() { throw null; }
        public bool WaitForInputIdle(int milliseconds) { throw null; }

Same methods

Process::WaitForInputIdle ( int milliseconds ) : bool

Usage Example

Esempio n. 1
0
        public static void BringWindowToFront(int processid)
        {
            //get the process
            System.Diagnostics.Process bProcess = System.Diagnostics.Process.GetProcessById(processid);// FirstOrDefault<System.Diagnostics.Process>;

            //check if the process is nothing or not.
            if (bProcess != null)
            {
                //get the (int) hWnd of the process
                IntPtr hwnd = bProcess.MainWindowHandle;
                //check if its nothing
                if (hwnd != IntPtr.Zero)
                {
                    //if the handle is other than 0, then set the active window
                    bProcess.WaitForInputIdle();
                    SetForegroundWindow(hwnd);
                }
                else
                {
                    //we can assume that it is fully hidden or minimized, so lets show it!
                    bProcess.WaitForInputIdle();
                    ShowWindow(hwnd, ShowWindowEnum.Restore);
                    SetForegroundWindow(hwnd);
                }
            }
            else
            {
                //tthe process is nothing, so start it
                //System.Diagnostics.Process.Start(@"C:\Program Files\B\B.exe");
            }
        }
All Usage Examples Of System.Diagnostics.Process::WaitForInputIdle