title: Caret position on webbrowser
body: <p>I'm trying to get the id of a htmlinputtextelement in webbrowser where the caret is blinking. So when I press TAB it changes. </p>
  
  <p>How can I do this in delphi?</p>
  
  <p>You know when you go onto a website and there are multiple inputtextelements. You can scroll through them by pressing TAB. When you are finished with box 1, TAB, fill in box 2, TAB, box 3, TAB till you have completed the form on the website. I want to do this. By knowing what the id is of the inputtextelement that the current caret is in. </p>
  
  <p>You can get the mouse position with getcursorpos. can you get the caret position the same way? They do not give the same location for x and y...??</p>
  
  <pre><code>procedure TForm1.Button2Click(Sender: TObject);
  var
    MausPos: TPoint;
    HtmlElement: IHTMLElement;
      iHTMLDoc: IHtmlDocument2;
      tag1:string;
      id1:string;
  begin
    if Supports(webbrowser1.Document, IHtmlDocument2, iHTMLDoc) then
    begin
      if GetcaretPos(MausPos) then
      begin
        MausPos := webbrowser1.screentoclient(MausPos);
        HtmlElement := iHTMLDoc.ElementFromPoint(MausPos.X, MausPos.Y);
  </code></pre>