2020国产成人精品视频,性做久久久久久久久,亚洲国产成人久久综合一区,亚洲影院天堂中文av色

分享

給TWebBrowser添加鼠標(biāo)事件

 獨(dú)孤求財(cái) 2022-08-04 發(fā)布于廣東
unit   Unit1;
interface
uses
    Windows,   Messages,   SysUtils,   Variants,   Classes,   Graphics,   Controls,   Forms,
    Dialogs,   OleCtrls,   SHDocVw,   StdCtrls,   MSHTML;
type
    TForm1   =   class(TForm)
        WebBrowser1:   TWebBrowser;
        procedure   FormCreate(Sender:   TObject);
        procedure   WebBrowser1DocumentComplete(Sender:   TObject;
            const   pDisp:   IDispatch;   var   URL:   OleVariant);
    private
        {   Private   declarations   }
        FLoaded:   Boolean;
        procedure   AppMsg(var   Msg:   TagMsg;   var   Handled:   Boolean);
        procedure   GetContronl;
    public
        {   Public   declarations   }
    end;
var
    Form1:   TForm1;
implementation
{$R   *.dfm}
procedure   TForm1.AppMsg(var   Msg:   TagMsg;   var   Handled:   Boolean);
var
    mPoint   :   TPoint;
begin
    if   IsChild(WebBrowser1.Handle,   Msg.Hwnd)   and
          (Msg.Message   =   WM_MOUSEMOVE)   and   FLoaded   then
    begin
        GetCursorPos(mPoint);
        GetContronl;
        //PopupMenu1.Popup(mPoint.X,   mPoint.Y);
        Handled:=True;
    end;
end;
procedure   TForm1.FormCreate(Sender:   TObject);
begin
    FLoaded   :=   False;
    WebBrowser1.Navigate( 'http://www. ');
    Application.OnMessage   :=   AppMsg;
end;
procedure   TForm1.GetContronl;
var
    E:   IHTMLElement;
    tmpStr:   String;
    myPoint:   TPoint;
begin
    myPoint   :=   Mouse.CursorPos;
    myPoint   :=   WebBrowser1.ScreenToClient(myPoint);
    {
    myPoint.X   :=   myPoint.X   +   100;
    myPoint.Y   :=   myPoint.Y   +   100;
    }
    E   :=   (WebBrowser1.Document   as   IHTMLDocument2).elementFromPoint(myPoint.X,   myPoint.Y);
    //E   :=   (WebBrowser1.Document   as   IHTMLDocument2).elementFromPoint(100,   100);
      //ShowMessage(E.title);
      tmpStr   :=   Format( '%s,%s,%s,%s;X:%d;Y:%d ',[E.className,E.id,E.tagName,E.innerHTML,
        myPoint.X,myPoint.Y]);
    Caption   :=   tmpStr;
end;
procedure   TForm1.WebBrowser1DocumentComplete(Sender:   TObject;
    const   pDisp:   IDispatch;   var   URL:   OleVariant);
begin
    FLoaded   :=   True;
end;
end.

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章