Click here to Skip to main content
15,843,145 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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……….

Use the ShellExecute function in that button click event.


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

for eg:


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

All The Best.
Share this answer

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 ;)[^]

Using the WebBrowser control, simplified[^][^]

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

Best Regards.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900