예제 #1
0
        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();
        }
예제 #2
0
 public static VZ_AppProcessHelper getSingleton()
 {
     if (singleton == null)
     {
         singleton = new VZ_AppProcessHelper();
     }
     return(singleton);
 }
예제 #3
0
 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);
 }