SendKeys.Send : Access is denied
<p>I have an Application which uses SendKeys.Send function to <code>send CTRL+C and CTRL+V Keys.</code> My operating system is <code>Windows Server 2012 R2</code>. It sends the keys at first with no problem but then it says Access is Denied. Why ? </p>

<p>I have tried to use these two methods,</p>

<pre><code>SendKeys.Send() 
</code></pre>

<p>and</p>

<pre><code>My.Computer.Keyboard.SendKeys()
</code></pre>

<p>Both the functions giving the same Error at certain point.</p>

<p>Why it's not allowing me to send keys ?</p>

<pre><code>************** Exception Text **************
System.ComponentModel.Win32Exception (0x80004005): Access is denied
   at System.Windows.Forms.SendKeys.SendInput(Byte[] oldKeyboardState, Queue previousEvents)
   at System.Windows.Forms.SendKeys.Send(String keys, Control control, Boolean wait)
   at Microsoft.VisualBasic.Devices.Keyboard.SendKeys(String keys)
   at WhatsApp_API_Sender.Form1.timercron_Tick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
</code></pre>