Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Opening web pages in win32

This topic is 6932 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

Is there a Win32 function that when called can open the default web browser and load a specific html document? I remember seeing something similar to this in a book but I lost the book! I have seen many programs in windows that use a web page for a help document but I can''t seem to find out how they did it.

Share this post

Link to post
Share on other sites
Their is an easy way and a hard way.
I'll show you the easy:

You must use the api function: ShellExecute().

Here is how you open the web-site to altavista.com:
NULL, // Parent window
_T("open"), // command verb thing
_T("URL=http://www.altavista.com"), // Adresse thing
NULL, // file-params
NULL, // Can´t remeber just NULL
SW_MAXIMIZE) // Show-param.

Please look this function up, because I can´t recall all it´s params.

- Hope this will work -

Edited by - The big Question? on 4/26/00 3:44:19 PM

Share this post

Link to post
Share on other sites
I tried ShellExecute but it did not work!

I found some info on this function at the url below:


Share this post

Link to post
Share on other sites
Please notice, I forgot to tell you something which could be important.

This only works if the user has connected the *.htm/*.html files with a browser.

What I´m trying to say is simply, even through the user has installed a browser, this might not work, if he has disconnected some default-settings.
But this trick works 95% of the time, so it´s not bad.

(If you need a more safe method you need dig into the WinInet, which is rather long and complex API (MS keeps adding to it!)).

By the way you can also use this to start the Mail-program (Outlook or whatever), so the user can email you, just use "mailto:bla@bla.com" instead of the "URL=bla-bla" stuff.

- The Big ? -

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!