How to send Keys to an application
<p>I have a very basic problem, For a game (Dota 2) I want to write a little macro which opens the console, writes "setinfo name ".........................."" into it and then closes it, the hotkey for console is set to '#'. For this I wrote an application which listens for the key 'f' to be pressed, and then send</p>

<pre><code>1) '#' (open the console)
2) "messag ebla bla b...."
3) '#' (close the console)
</code></pre>

<p>everything is working except that it will not open the console (but if the console is already open it will write #messagej.j....# into it when i press f just as wanted)</p>

<p>my code for sending the keys.</p>

<pre><code>SendKeys.Send("#");
SendKeys.Send("my message for consol");
SendKeys.Send("#");
</code></pre>

<p>does anybody know why the hotkeys dont work by sending keys? I thought its an simulation of when the user presses F or Q.</p>
