打开默认Web浏览器控件 [英] Open default web browser control

查看:132
本文介绍了打开默认Web浏览器控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的应用程序中,当用户点击按钮时,我必须打开默认的Web浏览器。我们必须打开默认浏览器而不管位置(默认Web浏览器路径)。

因为应用程序必须在不同的机器上打开默认Web浏览器,所以默认Web浏览器的位置可能不同... ............

所以请帮助我.........你的宝贵意见............

谢谢.........。

Hi,
In my application I have to open default web browser when user clicks on a button. We have to open the default browser irrespective of the location(default web browser path).
Because the application has to open the default web browser in different machines there the location of default web browser may be different……………
So please help me………with your valuable suggestions………….
Thank you……….

推荐答案

在该按钮点击事件中使用ShellExecute函数。



语法:



Use the ShellExecute function in that button click event.

syntax:

HINSTANCE ShellExecute(
		_In_opt_  HWND hwnd,
		_In_opt_  LPCTSTR lpOperation,
		_In_      LPCTSTR lpFile,
		_In_opt_  LPCTSTR lpParameters,
		_In_opt_  LPCTSTR lpDirectory,
		_In_      INT nShowCmd
		);







例如:< br $>


ShellExecute(0,0,www.google.com,0,0,SW_SHOWNORMAL);



当您单击该按钮时,默认浏览器会自动打开用这个URL。



All The Best。




for eg:

ShellExecute(0,0,"www.google.com",0,0,SW_SHOWNORMAL);

when you click on that button the default browser automatically opens with that URL.

All The Best.






在您的应用程序中,您可以使用托管的默认Web浏览器,请按照链接获取更多信息,这些链接可以真正用于您的目的;)



http://msdn.microsoft.com/en-us/library/aa752046 (v = vs.85).aspx [ ^ ]



使用WebBrowser控件,简化 [ ^ ]



http://computer-programming-forum.com/82-mfc/c57bb118d81 bf221.htm [ ^ ]



当然你可以使用C ++ / CLI将MFC与.NET技术和实验室实验室集成;)



最好的问候。
Hi

In your application you can use hosted default web browser please follow of links for get the more information these links can be really use-full for your purpose ;)

http://msdn.microsoft.com/en-us/library/aa752046(v=vs.85).aspx[^]

Using the WebBrowser control, simplified[^]

http://computer-programming-forum.com/82-mfc/c57bb118d81bf221.htm[^]

Of course you can use C++/CLI for integration MFC with .NET technology and lab lab lab ;)

Best Regards.


这篇关于打开默认Web浏览器控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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