title: ASCII Values For Keyboard Key Press Events?
body: <p>I borrowed someones code that sends a key event to another process (hWnd). Here is the definition of that function:</p>
  
  <pre><code>public static void SendKey(ushort key, IntPtr hWnd)
  {
      SetActiveWindow(hWnd);
      SendMessage(hWnd, WM_KEYDOWN, key, 0);
      SendMessage(hWnd, WM_KEYUP, key, 0);
  }
  </code></pre>
  
  <p>Where SendMessage is taken from a DllImport:</p>
  
  <pre><code>//sends a windows message to the specified window
  [DllImport("user32.dll")]
  public static extern int SendMessage(IntPtr hWnd, int Msg, uint wParam, int lParam);
  </code></pre>
  
  <p>As you can see, the SendKey method takes a <strong>ushort</strong> value for the key to be sent. </p>
  
  <p>Does anyone know where I can find these values? I.e. if the user pressed the "7" key and I wanted to forward it how to i go from the 7 key event/callback to a ushort value?</p>
  
  <p>Thanks!</p>