title: C# macro application
body: <p>I'm trying to create a winform C# application, which will send keystrokes to a program, acting like a macro application (sending keystrokes). 
  I am using Windows Input Simulator. <em><a href="https://inputsimulator.codeplex.com/" rel="nofollow">https://inputsimulator.codeplex.com/</a></em></p>
  
  <p>The problem is that it can only send keystrokes to a program with admin right, if the application I created also runs with admin rights. The only way I've found to run a <em>.application</em> file is by using CMD, which is a headache, any other ways to do it?</p>
  
  <p>Second it does not seem to work with all programs. I have trouble trying to send keystrokes to <em>Avid - Pro Tools</em>. Maybe there is another method of sending keystrokes?</p>
  
  <p>I can easily achieve macros with my <em>Logitech</em> mouse, why can't I do that with programming? Am I missing something?</p>
  
  <p>Here's to focus an application code:</p>
  
  <pre><code>protected override CreateParams CreateParams
      {
          get
          {
              CreateParams param = base.CreateParams;
              param.ExStyle |= 0x08000000;
              return param;
          }
      }
  </code></pre>
  
  <p>And a sample send code:</p>
  
  <pre><code>private void audioTrack_Click(object sender, EventArgs e)
      {
  
          InputSimulator.SimulateModifiedKeyStroke(
             new[] { VirtualKeyCode.CONTROL, VirtualKeyCode.SHIFT },
             new[] { VirtualKeyCode.VK_N });
  
          InputSimulator.SimulateKeyDown(VirtualKeyCode.RETURN);
      }
  </code></pre>