カレットが点滅しているウェブブラウザでhtmlinputtextelementのIDを取得しようとしています。したがって、Tabキーを押すと変化します。
どうすればデルファイでこれを行うことができますか?
Webサイトにアクセスすると、複数のinputtextelementsがあります。Tabキーを押すと、それらをスクロールできます。ボックス1、TABを使い終わったら、Webサイトのフォームに記入するまで、ボックス2、TAB、ボックス3、TABに入力します。これをやりたいです。現在のカレットが含まれているinputtextelementのIDが何であるかを知ることによって。
getcursorposを使用してマウスの位置を取得できます。同じようにカレットの位置を取得できますか?彼らはxとyに同じ場所を与えません...??
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);