예제 #1
0
        /// <summary>
        /// 스크린 세이버 시작
        /// </summary>
        private void StartScreenSaver()
        {
            if (SoundService.isAlramUseOn = true && frmMain._isLock == false)
            {
                return;
            }

            _calcReduction.OperationEndTime = DateTime.Now;

            //this.sendPCEnergy("2");

            _screensaverStatus = true;
            ScreenSaverSetting();
            Thread.Sleep(100);


            _calcReduction.ScreenStartTime = DateTime.Now;

            //모니터 + 본체 절전
            if (AppConfig.Instance.SleepMode == 1)
            {
                System.Windows.Forms.Application.SetSuspendState(System.Windows.Forms.PowerState.Suspend, false, false);
            }
            // 모니터 절전 진입
            else
            {
                SoundService.SendMessage(this.Handle.ToInt32(), SoundService.WM_SYSCOMMAND, SoundService.SC_MONITORPOWER, SoundService.MONITOR_OFF);
            }
        }
예제 #2
0
        /// <summary>
        /// 스크린 세이버 해재
        /// </summary>
        private void StopScreenSaver()
        {
            //this.sendPCEnergy("3");

            // 컴퓨터 절전해제
            SoundService.mouse_event(SoundService.MOUSE_MOVE, 0, 1, 0, UIntPtr.Zero);
            Thread.Sleep(40);
            SoundService.mouse_event(SoundService.MOUSE_MOVE, 0, -1, 0, UIntPtr.Zero);

            _calcReduction.OperationStartTime = DateTime.Now;
            _calcReduction.ScreenEndTime      = DateTime.Now;


            //화면보호기 종료
            screenSaverAllStop();
            //KeyboardHooking.TaskBarShow();
            SoundService.AlertSoundStop();

            try
            {
                _uc_TabMain.UpdateUI();
            }
            catch (Exception ea)
            {
                _log.write(ea.Message);
                frmMain._log.write(ea.StackTrace);
            }

            _screensaverStatus = false;
            SoundService.SendMessage(this.Handle.ToInt32(), SoundService.WM_SYSCOMMAND, SoundService.SC_MONITORPOWER, SoundService.MONITOR_ON);
        }