Exemplo n.º 1
0
        private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            _tScreenshot.Stop();

            JcUtility.UnregisterHotKey(this.Handle, 101);
            JcUtility.UnregisterHotKey(this.Handle, 102);
        }
Exemplo n.º 2
0
 private void tsbUninstall_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to uninstall this program?", "Uninstall Confirm", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         Process.Start(Path.Combine(JcUtility.GetAppDir(), "uninst.exe"));
         Close();
     }
 }
Exemplo n.º 3
0
 private void _tScreenshot_Tick(object sender, EventArgs e)
 {
     try
     {
         JcUtility.Screenshot();
     }
     catch (Exception ex)
     {
         JcUtility.Log("_tScreenshot_Tick Exeption:");
         JcUtility.LogException(ex);
     }
 }
Exemplo n.º 4
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            IntPtr hMutex;

            hMutex = JcUtility.CreateMutex(null, false, "JcScreenCapture");
            if (JcUtility.GetLastError() == JcUtility.ERROR_ALREADY_EXISTS)
            {
                Environment.Exit(0);
            }

            if (_config.AutoHide)
            {
                this.BeginInvoke(new MethodInvoker(delegate() {
                    this.Hide();
                    this.Opacity = 1;
                }));
            }
            else
            {
                this.Opacity = 1;
            }

            JcUtility.RegisterHotKey(this.Handle, 101, JcUtility.KeyModifiers.Ctrl | JcUtility.KeyModifiers.Shift, Keys.J);
            JcUtility.RegisterHotKey(this.Handle, 102, JcUtility.KeyModifiers.Ctrl | JcUtility.KeyModifiers.Alt, Keys.J);

            try
            {
                JcUtility.Screenshot();
            }
            catch (Exception ex)
            {
                JcUtility.Log("Screenshot Exeption:");
                JcUtility.LogException(ex);
            }

            _tScreenshot.Start();

            cbAutoRun.Checked          = _config.AutoRun;
            cbAutoHide.Checked         = _config.AutoHide;
            cbAutoRun.CheckedChanged  += new EventHandler(cbAutoRun_CheckedChanged);
            cbAutoHide.CheckedChanged += new EventHandler(cbAutoHide_CheckedChanged);

            JcUtility.ClearLogs();
            JcUtility.ClearScreenshots();
        }
Exemplo n.º 5
0
 private void cbAutoRun_CheckedChanged(object sender, EventArgs e)
 {
     JcUtility.SetAutoRun(cbAutoRun.Checked);
     _config.AutoRun = cbAutoRun.Checked;
 }
Exemplo n.º 6
0
 private void tsbShowScreenshot_Click(object sender, EventArgs e)
 {
     JcUtility.OpenExplorer(JcUtility.GetScreenshotDir());
 }