title: Simulating a Click on C# Web Browser at a specific point
body: <p>I'm trying to force a mouse click within my webbrowser at a specific point.</p>
  
  <p>I'm using the following code:</p>
  
  <pre><code>    public void DoMouseClick(int X, int Y)
      {
          //Call the imported function with the cursor's current position
          mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
      }
  
  
  
  [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
      public static extern void mouse_event(uint dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
  
      private const int MOUSEEVENTF_LEFTDOWN = 0x02;
      private const int MOUSEEVENTF_LEFTUP = 0x04;
      private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
      private const int MOUSEEVENTF_RIGHTUP = 0x10;
  </code></pre>
  
  <p>However this code doesn't appear to be working at all, it isn't clicking there? I also am not sure whether this code actually moves the phsyical mouse or not, I need something that simulates a click not moves my mouse there and does the click.</p>
  
  <p>I cannot use the HTMLElement stuff because that doesn't allow you to click a specific co-ordinate in the element, which I require, I need to click a very specific spot.</p>
  
  <p>Could any one help with this</p>