Jump to content
  • Advertisement
Sign in to follow this  
froghaus

Opening Web Browser

This topic is 4483 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on an advertising system that would allow my game to host advertising banners and open a web browser window when the player clicks on the ad. What code could I use to do this? Basically, all I want to do is say: if(user_clicks_on_ad) { tell_windows_to_fire_up_the_browser("hey_browser_open_this_address"); } Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
There's a description of one approach here.

Quote:

6 Full examples:
Launches index.html in Internet Explorer:
int PASCAL WinMain(HANDLE,HANDLE,LPSTR,int)
{
ShellExecute(NULL,"open","iexplore","index.html",NULL,SW_SHOWNORMAL);
return 0;
}

Launches index.html in the user's default HTML viewer:
int PASCAL WinMain(HANDLE,HANDLE,LPSTR,int)
{
ShellExecute(NULL,"open","index.html",NULL,NULL,SW_SHOWNORMAL);
return 0;
}

7 To make the application more robust, you may wish to add error checking to the ShellExecute call. Visit ShellExecute (MSDN Library) for the official Microsoft technical information on this command.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!