示例#1
0
 private bool WaitActive(int ms = 500, int times = 20)
 {
     while (times > 0 && WindowFinder.GetForegroundWindow() != Handle)
     {
         StaticSleeper.Sleep(ms);
         times--;
     }
     return(times > 0);
 }
示例#2
0
 public void MakeActive()
 {
     for (var i = 0; i < 12; i++)
     {
         WindowFinder.SetForegroundWindow(Handle);
         if (!WaitActive())
         {
             continue;
         }
         Screen.Dirty();
         StaticSleeper.Sleep(500);
         return;
     }
     throw new Exception("Window never opened!");
 }
示例#3
0
 protected string GetWindowText()
 {
     return(WindowFinder.GetWindowText(Handle));
 }