/// <summary> /// This button is necessary only for now, that is to unlock /// the screen without recording any brain waves. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void exitButton_Click(object sender, EventArgs e) { // this.Close(); try { screenLockObj.removeFromStartup(); screenLockObj.maximizeWindow(); screenLockObj.releaseHook(); } catch (Exception ex) { } //Process screenLockPromptProcess = new Process(); try { //screenLockPromptProcess.StartInfo.WorkingDirectory = Environment.CurrentDirectory; //screenLockPromptProcess.StartInfo.FileName = "Screen Lock Prompt"; //screenLockPromptProcess.Start(); ClosingTheAppFlag = true; Application.Exit(); } catch (Exception ex) { MessageBox.Show(Environment.CurrentDirectory); MessageBox.Show(ex.Message); Application.Exit(); } }
private void enableStartupCheckBox_CheckedChanged(object sender, EventArgs e) { if (enableStartupCheckBox.Checked == true) { screenLockObj.addtoStartup(); RunAtStartup = true; } else { screenLockObj.removeFromStartup(); RunAtStartup = false; } }