500分CppWebBrowser相关问题之最后100分

dxqxiaoqiang 2006-02-27 11:03:37
第1个200分见:
http://community.csdn.net/Expert/topic/4568/4568210.xml?temp=.2989008
第2个200分见:
http://community.csdn.net/Expert/topic/4570/4570380.xml?temp=.5972101

如果前两个问题圆满解决,这个100分也可能会加送给前两个问题的解决者。

再问一个问题,如何对判断并对CppWebBrowser弹出的对话框进行点击“确定”操作。
...全文
254 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
yy2001 2006-03-03
  • 打赏
  • 举报
回复
关注,学习。。
minlulu 2006-03-01
  • 打赏
  • 举报
回复
关注
dxqxiaoqiang 2006-02-28
  • 打赏
  • 举报
回复
jiangsheng,
Can I ask you another question?
How to copy the Image in the CppWebBrowser or from Temporary Internet Files directory?
Thank you.
dxqxiaoqiang 2006-02-28
  • 打赏
  • 举报
回复
jiangsheng,
    Thanks you for your advice.
dxqxiaoqiang 2006-02-28
  • 打赏
  • 举报
回复
IDocHostShowUI
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.

Show Example

HRESULT 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;
}

Security Alert Using LoadLibrary incorrectly can compromise the security of your application by loading the wrong DLL. Refer to the LoadLibrary documentation for information on how to correctly load DLLs with different versions of Windows.

失落的羊 2006-02-28
  • 打赏
  • 举报
回复
关注!顺便帮顶!呵呵
蒋晟 2006-02-28
  • 打赏
  • 举报
回复
First,create a control range from the body element
Second, add the image element to the control range
Next, call IHTMLControlRange::execCommand with the command name "copy"
蒋晟 2006-02-27
  • 打赏
  • 举报
回复
IDocHostShowUI::ShowMessage

http://msdn.microsoft.com/workshop/browser/hosting/wbcustomization.asp

1,317

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 网络及通讯开发
社区管理员
  • 网络及通讯开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧