在线等待中, 先谢谢了。
解决方案 »
- 2000,XP下如何防止中止进程!
- 怎样在spread控件中设置焦点单元格
- 求一本VB书<Visual Basic数据库编程技术与实例>原价49元中的光盘镜像..
- 请问自己编写的VBScript 小程序文件应该用什么应用程序打开?
- 还是VB
- 有谁知道hookWM_ACTIVATEAPP或WM_ACTIVATE该用什么hook类型.了解消息或hook的进
- 如何判断鼠标离开了一个窗口的显示区
- 数据表显示问题。。请问我要如何才能实现如下功能,datagrid好像不行啊:(
- 想成立分析小组,请求支援!
- 请教哪位大虾能帮我完成一个登录程序的设计,拜托!!!!! 快、快、快!!!!
- 请问各位从哪里能找到VB高手?或是WINDOWS编程高手?或API高手?
- 急!急!急!有何错误
新开一个线程(或用全局的cbt钩子)不停的查找弹出的对话框(用findwindow),如果对话框是你要控制的,则查找确定按钮(用findwindowex等),获得按钮句柄后,用sendmessage发送
bm_click消息
//新开一个线程(或用全局的cbt钩子)不停的查找弹出的对话框(用findwindow),如果对话框是你要控制的,则查找确定按钮(用findwindowex等),获得按钮句柄后,用sendmessage发送bm_click消息这个不是很明白,能不能说得详细一点,我正好需要同楼主一样的功能的程序
http://msdn.microsoft.com/workshop/browser/hosting/wbcustomization.asp
Take Total Control of Internet Explorer with Advanced Hosting
http://www.microsoft.com/mind/1098/advhost/advhost.asp
An ATL control for hosting and customization of multiple instances
www.codeproject.com/atl/vbmhwb.asp
Q261003 HOWTO: Handle Script Errors as a WebBrowser Control Host
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q261003
Q183235 WBCustomizer.dll Implements IDocHostUIHandler for VB
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q183235
//新开线程怎么弄,全局ctb钩子又是什么意思?
其实不建议这样做,vb中很难安全的实现多线程,而全局cbt钩子又需要用vc做一个额外的dll,
参考:
http://www.china-askpro.com/msg2/qa20.shtml
http://www.zahui.com/html/3/6315.htm
WBCustomizer.dll 我用了,但好像是禁用快捷键及浏览器菜单之类的,不能屏蔽弹出式窗口,而现在我是想屏蔽网页中用alert弹出的确定对话框(类名和msgbox弹出的对话框一样)
pDisp.Document.parentWindow.execScript "window.alert=null;"
End Sub
This interface gives you control over the message boxes and help files displayed by the WebBrowser Control. It works the same way as IDocHostUIHandler and IDocHostUIHandler2 in that you implement it so the WebBrowser Control can call your IDocHostShowUI methods before it displays any messages or help menus of its own. This gives you a chance to prevent the WebBrowser Control from displaying anything and enables you to display your own custom message or help instead. IDocHostShowUI has two methods, IDocHostShowUI::ShowMessage and IDocHostShowUI::ShowHelp. IDocHostShowUI::ShowMessage
Return S_OK to disable WebBrowser Control messages. Any other return value, like S_FALSE or E_NOTIMPL, allows the WebBrowser Control to display with its message box.One nice thing you can do with this method is customize the message box captions for your application so they don't read "Microsoft Internet Explorer." You can do this by comparing the caption string in lpstrCaption with the string resource Internet Explorer uses, which is stored in Shdoclc.dll. It is identified by the symbol IDS_MESSAGE_BOX_TITLE, whose value is 2213. The following code snippet shows how you might do this.Hide ExampleHRESULT CBrowserHost::ShowMessage(HWND hwnd,
LPOLESTR lpstrText,
LPOLESTR lpstrCaption,
DWORD dwType,
LPOLESTR lpstrHelpFile,
DWORD dwHelpContext,
LRESULT *plResult)
{
USES_CONVERSION;
TCHAR pBuffer[50]; // resource identifier for window caption "Microsoft Internet Explorer"
#define IDS_MESSAGE_BOX_TITLE 2213 // Load Shdoclc.dll and the IE message box title string
HINSTANCE hinstSHDOCLC = LoadLibrary(TEXT("SHDOCLC.DLL")); if (hinstSHDOCLC == NULL)
{
// Error loading module -- fail as securely as possible
return;
}
LoadString(hinstSHDOCLC, IDS_MESSAGE_BOX_TITLE, pBuffer, 50); // Compare the IE message box title string with lpstrCaption
// If they're the same, substitute your own Caption
if (_tcscmp(OLE2T(lpstrCaption), pBuffer) == 0)
lpstrCaption = L"Custom Caption"; // Create your own message box and display it
*plResult = MessageBox(OLE2T(lpstrText), OLE2T(lpstrCaption), dwType); // Unload Shdoclc.dll and return
FreeLibrary(hinstSHDOCLC);
return S_OK;
}