onmousemove { get the current link content; if(state.contains(ss.left) shellexecute(); }
//get the current link content; 怎么实现我想用 Delphi自带的webbrower来做
这里有个代码,大概可以实现获取链接。不过好像“急速浏览器”没那么复杂啊 procedure TForm1.getHtmlCtrlName(); var E:IHTMLElement; p:TPoint; begin p := Mouse.CursorPos; p := wb.ScreenToClient(p);
E := (wb.Document as IHTMLDocument2).elementFromPoint(p.X,p.Y); Label1.Caption := Format('className:%s,id:%s,tagName:%s,innerHTML:%s;X:%d;Y:%d',[E.className,E.id,E.tagName,E.innerHTML,p.X,p.Y]); try Label2.Caption := E.getAttribute('href',1); except Label2.Caption := '不是超链接'; end; end;
{
get the current link content;
if(state.contains(ss.left)
shellexecute();
}
//get the current link content;
怎么实现我想用 Delphi自带的webbrower来做
procedure TForm1.getHtmlCtrlName();
var
E:IHTMLElement;
p:TPoint;
begin
p := Mouse.CursorPos;
p := wb.ScreenToClient(p);
E := (wb.Document as IHTMLDocument2).elementFromPoint(p.X,p.Y);
Label1.Caption := Format('className:%s,id:%s,tagName:%s,innerHTML:%s;X:%d;Y:%d',[E.className,E.id,E.tagName,E.innerHTML,p.X,p.Y]);
try
Label2.Caption := E.getAttribute('href',1);
except
Label2.Caption := '不是超链接';
end; end;
然后应该能使用代码在新的浏览器中打开那个链接吧。
接收的方式有两种, 一种是将窗口注册为oleDrop对象,然后在onDrop中获取超链接,另一种是使用TDragDrop组件中的接收超链接的那个组件。
这里http://hi.baidu.com/orxor/blog/item/dad19f3ced930705baa16708.html
我需要的是,类似 遨游 一样。在网页中拖动一个连接,会在新页面打开。或者拖动选取的几个字,会打开搜索