示例#1
0
        // 폼 클로즈
        private void FormScreenSaver_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                // 폼 애니메이션(아래서 위로)
                AnimateWindow(this.Handle, 500,
                              AnimateWindowFlags.AW_VER_NEGATIVE | AnimateWindowFlags.AW_HIDE);

                if (KeyboardHooking.WINDOWSTATUS == KeyboardHooking.SWP_HIDEWINDOW)
                {
                    KeyboardHooking.TaskBarShow(); // 작업표시줄 드러냄
                }

                // 키보드 후킹 해제
                KeyboardHooking.UnHookWindowsEx(intLLKey);
                KeyboardHooking.UnBlockCtrlAltDel();

                main.rcvRssi = default(int);

                this.Dispose();
            }
            catch (Exception ee)
            {
                Console.WriteLine("Saver Closing");
            }
        }
示例#2
0
        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            try
            {
                // 키보드 후킹 해제
                KeyboardHooking.UnHookWindowsEx(intLLKey);

                System.Diagnostics.Process.GetCurrentProcess().Kill();
            }
            catch (Exception ea)
            {
                _log.write(ea.Message);
                frmMain._log.write(ea.StackTrace);
            }
        }
示例#3
0
        public FormScreenSaver(MainForm main)
        {
            try
            {
                InitializeComponent();
                this.main = main;
                //main.SetFormScreenSaver(this);

                FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                StartPosition   = FormStartPosition.Manual;
                TopMost         = true;
                ShowInTaskbar   = false;

                pb_screenSaver.BringToFront();

                // 키보드 후킹
                intLLKey = KeyboardHooking.SetHook(KeyboardHooking.hookProc);
                KeyboardHooking.BlockCtrlAltDel();
            }
            catch (Exception ex)
            {
                Console.WriteLine("ScreenSaverForm_init");
            }
        }
示例#4
0
 // 폼 액티베이티드
 private void FormScreenSaver_Activated(object sender, EventArgs e)
 {
     KeyboardHooking.TaskBarHide(); // 작업표시줄 숨김
 }
示例#5
0
        public frmMain()
        {
            InitializeComponent();

            RegisterForPowerNotifications();

            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);


            //this.uc_MainEnergy1.Parent = this;

            Globals._language = Thread.CurrentThread.CurrentCulture.Name;

            initLanguage();

            _calcReduction.OperationStartTime = DateTime.Now;



            SetMainDate();


            // 모니터 정확 해상도를 받기위한 DPI 세터 추가
            //DpiManager.SetDpiAwareness();

            //1. 자동 업데이트 추가
            if (UpdateChecker.NeedUpdate(this))
            {
                if (MessageBox.Show(GreenLock.languages.GreenLock.ClientUpdatedCheck, GreenLock.languages.GreenLock.StringConfirm, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
                {
                    UpdateChecker.RunClientUpdater();
                    this.DialogResult = DialogResult.Cancel;
                    return;
                }
            }

            //2. GreenLock 가동
            AppConfig.Instance.LoadFromFile();
            _calcReduction.LoadFromFile();

            _macAddress = AppConfig.Instance.DeviceAddress;

            if (_macAddress != "00:00:00:00:00:00")
            {
                AddEvent();
                _bt32FeetDevice.GetBtAddr(_macAddress);
                _bt32FeetDevice.Start();
            }
            else
            {
                MessageBox.Show(GreenLock.languages.GreenLock.execution_caution_msg, GreenLock.languages.GreenLock.execution_caution);
            }

            //3. 에너지 세팅
            _calcReduction.OnMainUpdate += _calcReduction_OnMainUpdate;

            //4. DB세팅
            DataBaseHelper helper = new DataBaseHelper();

            helper.EnsureSQLiteFileCreated();



            // 키보드 후킹 해제
            KeyboardHooking.UnBlockCtrlAltDel();
            intLLKey = KeyboardHooking.SetHook(KeyboardHooking.hookProc);

            _uc_TabMain      = new UC_Controls.Uc_TabMain();
            _uc_TabMain.Main = this;
        }