public static bool LoopAGK() { Application.DoEvents(); if (Agk.IsCapturingImage() > 0) { System.Threading.Thread.Sleep(10); } return(App.Status.IsRunning); }