禁止WebBrowser弹出网页对话框
来源:互联网 发布:软件开发成本 人月 编辑:程序博客网 时间:2024/05/06 20:13
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw;
type
TForm1 = class(TForm)
wb1: TWebBrowser;
procedure FormCreate(Sender: TObject);
private
procedure WMActivate(var Msg: TWMActivate);message WM_ACTIVATE;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMActivate(var Msg: TWMActivate);
var
S:String;
wnd:HWND;
I:Integer;
begin
If Msg.Active=0 then
begin
wnd := Msg.ActiveWindow;
I := GetWindowTextLength(wnd);
SetLength(S,I+1);
//the text of the specified window 's title bar
GetWindowText(Wnd, PChar(S),I+1);
If Pos( '来自网页的消息', S) > 0 then
Sendmessage(wnd,WM_CLOSE,0,0);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
wb1.Navigate('file://C:\Documents and Settings\Administrator\桌面\index.htm');
end;
end.
还有另一种方法,但是能力有限,怎么也看不懂。
IDocHostShowUI接口
http://blog.sina.com.cn/s/blog_4b3906920100npup.html
- 禁止WebBrowser弹出网页对话框
- 禁止WebBrowser控件弹出对话框
- C# WebBrowser 禁止WebBrowser控件弹出对话框
- 禁止Webbrowser控件的弹出脚本错误对话框
- C# 禁止 Webbrowser 控件的弹出脚本错误对话框
- vb2008 webbrowser 如何禁止 脚本错误提示 及弹出对话框
- C# 禁止 Webbrowser 控件的弹出脚本错误对话框
- 禁止webbrowser弹出窗口,禁止webbrowser读取缓存
- webbrowser屏蔽网页弹出框
- WinForm中的webBrowser控件禁止弹出新窗口
- Delphi_WebBrowser禁止弹出Alert对话框
- TWebBrowser禁止弹出Alert对话框
- 网页弹出对话框详解
- 网页弹出对话框
- 网页弹出对话框
- 网页弹出对话框
- 网页弹出对话框 详解
- 网页弹出对话框
- ORA-06519: 检测到活动的自治事务处理,已经回退
- ArcGIS Flex API for 3D—简介
- 材料管理系统中发现的问题
- ArcGIS Flex API for 3D—Papervision3D
- hust 1342 (有上下界的最小流)
- 禁止WebBrowser弹出网页对话框
- VS2008提示jquery(转自:http://blog.csdn.net/wanglong7505/article/details/6307126)
- ArcGIS Flex API for 3D—实现思路
- 目前使用的PIC的开发环境和开发工具以及涉及的PIC MCU
- 浅析Java抽象类和接口的比较
- 现状 心态
- ArcGIS Flex API for 3D—3D Map Control
- GCC的内嵌汇编语法 AT&T汇编语言语法
- adapter模式