Esempio n. 1
0
 public Form1()
 {
     InitializeComponent();
     manager = new LibraryManager();
     LibraryManager.form = this;
     comboBox1.SelectedIndex = 2;
     comboBox2.SelectedIndex = 1;
 }
Esempio n. 2
0
        private void SentKeys(SendMethod method)
        {
            int result = 0;

            switch (method)
            {
            case SendMethod.SM_ScanCode:
            {
                LibraryManager.SendKeyFlags flags = LibraryManager.SendKeyFlags.SKF_KeyPress;
                if (checkBox6.Checked)
                {
                    flags = flags | LibraryManager.SendKeyFlags.SKF_KeyExtended;
                }

                int scanCode = 0;

                try
                {
                    scanCode = int.Parse(sendText);
                }
                catch (Exception e)
                {
                    textBox15.Text = "E";
                    break;
                }

                result         = LibraryManager.sendKeyByScanCode(scanCode, flags);
                textBox15.Text = result.ToString();
                break;
            }

            case SendMethod.SM_VirtualCode:
            {
                LibraryManager.SendKeyFlags flags = LibraryManager.SendKeyFlags.SKF_KeyPress;
                if (checkBox7.Checked)
                {
                    flags = flags | LibraryManager.SendKeyFlags.SKF_KeyExtended;
                }

                int virtualCode = 0;

                try
                {
                    virtualCode = int.Parse(sendText);
                }
                catch (Exception e)
                {
                    textBox16.Text = "E";
                    break;
                }

                result         = LibraryManager.sendKeyByVirtualCode(virtualCode, flags);
                textBox16.Text = result.ToString();
                break;
            }

            case SendMethod.SM_Text:
            {
                result         = LibraryManager.sendText(sendText);
                textBox17.Text = result.ToString();
                break;
            }
            }

            button6.Enabled   = true;
            button7.Enabled   = true;
            button8.Enabled   = true;
            trackBar1.Enabled = true;
        }