如何在shell扩展中打开网页 [英] how to open webpage in shell extension

查看:123
本文介绍了如何在shell扩展中打开网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果要在树形扩展中的文件夹视图中打开网页,请单击树形视图中的文件夹名称或文件名,因此我编写了如下代码:
CShellView类:公共IShellView,公共IOleCommandTarget
{
....
}

CShellView :: OnCreate
{
... m_pWebBrowser2.CoCreateInstance(CLSID_InternetExplorer,NULL)
....
}


如果默认的Web浏览器是IE,则代码正确.如果不是IE中的默认Web浏览器,那是错误的.

因此,我使用CLSID_Webbrowser创建对象,但无法打开窗口并导致资源管理器错误.

我尝试创建一个包含webbrrowser控件的对话框,但它仍然是错误的.


除了OP的答案:我的问题是:如何在资源管理器的shell视图中显示网页?

I want to open a webpage in folder view in my shell extension if click a folder name or file name in tree view,so I written code like this:
class CShellView : public IShellView, public IOleCommandTarget
{
....
}

CShellView::OnCreate
{
...m_pWebBrowser2.CoCreateInstance(CLSID_InternetExplorer, NULL)
....
}


if the default web brower is IE,the code is right. if the default web browser in not IE, it is wrong.

So , I use CLSID_Webbrowser to create object, but it cann''t open a window and cause explorer error.

I try to create a dialog with webbrrowser control in it, but it still wrong.


Addition from OP''s answer: My question is: How to show a web page in shell view of explorer?

推荐答案

IWebBrowser2会仅适用于IE.如果要在默认的Web浏览器中打开URL,而不是在窗口中显示该URL,则可以使用ShellExecute或ShellExecuteEx函数. http://support.microsoft.com/kb/224816 [
IWebBrowser2 would work with IE only. If you want to open the URL in the default web browser rather than showing it inside your window then you can use ShellExecute or ShellExecuteEx functions. http://support.microsoft.com/kb/224816[^]


我的问题是:如何在
My question is: How to show a web page in shell view of exploer?


尝试ShellExceute(我确实忘记了它在C ++中的完成方式,但ShellExecute听起来像应该将您指向正确的方向).
Try ShellExceute (I forgot exactly how it''s done in C++, but ShellExecute sounds like it should point you in the right direction).


这篇关于如何在shell扩展中打开网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆