调用查找对话框

关键点

HTMLID_FIND = 1; //查找对话框

HTMLID_VIEWSOURCE= 2; //用记事本查看源代码
HTMLID_OPTIONS =3; //Internet选项

实现过程

uses ActiveX;
const
  CGID_WebBrowser: TGUID =
'{ED016940-BD5B-11cf-BA4E-00C04FD70816}';
  HTMLID_FIND = 1;     
//查找对话框
  HTMLID_VIEWSOURCE= 2; //查看源代码
  HTMLID_OPTIONS =3;   
//Internet选项
procedure WB_FindDialog(WebBrowser: TWebbrowser;
nCmdId:Cardinal);overload;
 
var
  CmdTarget : IOleCommandTarget;
  vaIn, vaOut: OleVariant;
  PtrGUID: PGUID;
begin
  New(PtrGUID) ;
  PtrGUID^ := CGID_WebBrowser;
  if WebBrowser.Document <> nil
then
    try
     
WebBrowser.Document.QueryInterface(IOleCommandTarget, CmdTarget)
;
      if CmdTarget <> nil
then
       
try
         
CmdTarget.Exec(PtrGUID, nCmdId, 0, vaIn, vaOut) ;
       
finally
         
CmdTarget._Release;
       
end;
    except
    end;
  Dispose(PtrGUID) ;
end;

delphi 查找对话框-LMLPHP

delphi 查找对话框-LMLPHP

delphi 查找对话框-LMLPHP

备注

相关链接

 
04-18 16:04