private void _tScreenshot_Tick(object sender, EventArgs e) { try { JcUtility.Screenshot(); } catch (Exception ex) { JcUtility.Log("_tScreenshot_Tick Exeption:"); JcUtility.LogException(ex); } }
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(); }