Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        void ButtonEvent()
        {
            try
            {
                // 패스워드가 일치할경우
                if (textBox1.Text == AppConfig.Instance.UserPassword)
                {
                    this.Close();
                    // 1. 스크린 세이버만 종료
                    Screen[] screen = Screen.AllScreens; // 시스템 내 모든 디스플레이 배열을 가져옴

                    if (formScreenSaver != null)
                    {
                        formScreenSaver.main.screenSaverAllStop();
                        formScreenSaver.main._screensaverPasswordflag = true;
                    }
                }
                else
                {
                    MessageBox.Show("비밀번호가 틀렸습니다. \n다시 입력해 주세요.");
                    SoundService.AlertSoundStartForce();
                    SoundService.isUsingSoundService = true;
                }
            }
            catch (Exception ex)
            {
                frmMain._log.write(ex.StackTrace);
            }
        }
Ejemplo n.º 4
0
        private void LidStatusChanged(bool isLidOpen)
        {
            //if (isLidOpen)
            //{

            //MessageBox.Show("Lid is now open");
            //}
            // else
            // {
            if (SoundService.isAlramUseOn == true)
            {
                SoundService.AlertSoundStart();
            }
            else
            {
                SoundService.AlertSoundStop();
            }



            //}
        }
Ejemplo n.º 5
0
        public void screenSaverAllStop()
        {
            try
            {
                foreach (Form frm in this.OwnedForms)
                {
                    frm.Close();
                    frm.Dispose();
                }

                //MainForm.log.write("screenSaver != null" + (screenSaver != null));
                //MainForm.log.write("screenSaver2 != null" + (screenSaver2 != null));

                _screensaverStatus = false;
                SoundService.AlertSoundStop();
                SoundService.isUsingSoundService = false;
            }
            catch (Exception ex)
            {
                frmMain._log.write(ex.Message);
                frmMain._log.write(ex.StackTrace);
            }
        }