private void AsyncRunApp2(VZ_AppInfo info, Process proc) { if (!info.appId.Equals("9")) { proc.WaitForInputIdle(); } Thread.Sleep(1000); System.Drawing.Rectangle monitor; if (info.monitorNO == 1) { monitor = VZ_AppProcessHelper.getSingleton().getMainScreen().WorkingArea; } else { monitor = VZ_AppProcessHelper.getSingleton().getSecondScreen().WorkingArea; } //monitor = VZ_AppProcessHelper.getSingleton().getSecondScreen().WorkingArea;//Screen.AllScreens[sNumberOfMonitor].WorkingArea; //change the window to the second monitor SetWindowPos(proc.MainWindowHandle, 0, monitor.Left, monitor.Top, monitor.Width, monitor.Height, 0); proList.Add(proc); currentInfo = info; resetAppTimer(); }
public static VZ_AppProcessHelper getSingleton() { if (singleton == null) { singleton = new VZ_AppProcessHelper(); } return(singleton); }
private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (currentInfo == null || proList.Count == 0) { closeAppTimer(); return; } System.Drawing.Rectangle monitor; if (currentInfo.monitorNO == 1) { monitor = VZ_AppProcessHelper.getSingleton().getMainScreen().WorkingArea; } else { monitor = VZ_AppProcessHelper.getSingleton().getSecondScreen().WorkingArea; } //change the window to the second monitor SetWindowPos(proList[0].MainWindowHandle, 0, monitor.Left, monitor.Top, monitor.Width, monitor.Height, 0); }