Beispiel #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (0 == listViewKeys.Items.Count)
            {
                return; // no keys, no point!
            }
            if (btnStart.Text.Equals(ActionText.Stop.ToString()))
            {
                KeyCaptureLib.Shutdown();
                ConfigureControls(false);
            }
            else if (btnStart.Text.Equals(ActionText.Start.ToString()))
            {
                InitSave(false);
                if (!Dirty)
                {
                    ConfigureControls(true);
                    var eReturn = KeyCaptureLib.LoadFileAndCapture(m_sLoadedFile);
                    switch (eReturn)
                    {
                    case CaptureMessage.HookCreationSuccess:
                        break;

                    case CaptureMessage.HookCreationFailure:
                    case CaptureMessage.InputBad:
                    case CaptureMessage.InputMissing:
                    case CaptureMessage.InputZero:
                    default:
                        Console.WriteLine("Error: " + eReturn);
                        ConfigureControls(false);
                        break;
                    }
                }
            }
        }
Beispiel #2
0
 private void exitMainToolStripMenuItem_Click(object sender, EventArgs e)
 {
     m_bRun = false;
     if (WindowState == FormWindowState.Minimized)
     {
         WindowState = m_ePrevWindowState;
     }
     KeyCaptureLib.Shutdown();
     m_zIniManager.SetValue(Name, IniManager.GetFormSettings(this));
     Close();
 }