delphi에서 원소의 화면 위치 가져오기
597 단어 delphi
var
doc:IHTMLDocument3;
ele2:IHTMLElement2; p:TPoint; begin
doc:=WebBrowser1.Document as IHTMLDocument3;
ele2:=doc.getElementById('captchaImg') as IHTMLElement2;
p.X:=ele2.getBoundingClientRect.left+20; // p.Y:=ele2.getBoundingClientRect.top+15;
p:=WebBrowser1.ClientToScreen(p);//
SetCursorPos(p.X,p.Y);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
end;