title: simulate a keypress using sendmessage
body: <p>I want simulate a keypress but i have small problem.. What i do with hexadecimal ... its not even working :D Here is where i get that virtual-key hexadecimal: <a href="http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>  &lt;DllImport("user32.dll", CharSet:=CharSet.Auto)&gt; _
    Private Shared Function SendMessage2( _
    ByVal hwnd As IntPtr, _
    ByVal wMsg As Integer, _
    ByVal wParam As Integer, _
    &lt;MarshalAs(UnmanagedType.LPTStr)&gt; ByVal lParam As String) As Integer
    End Function
  
  SendMessage2(WindowHandle, 256, 0x0D, 0)
  SendMessage2(WindowHandle, 257, 0x0D, 65539)
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Argument not specified for parameter 'lParam' of 'Private Shared Function SendMessage2(hwnd As System.IntPtr, wMsg As Integer, wParam As Integer, lParam As String) As Integer'.
  Comma, ')', or a valid expression continuation expected.
  Too many arguments to 'Private Shared Function SendMessage2(hwnd As System.IntPtr, wMsg As Integer, wParam As Integer, lParam As String) As Integer'.
  </code></pre>