Jump to content
  • Advertisement
Sign in to follow this  
Awoken

Shellexecute

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

Hey guys, I'm making a program that with the press of a button open as many programs and webpages as I've specified for it to open.

Now I'm using VB 2008 and I can open programs with the shell command and open internet explorer to one specific website. However, I can't open multiple websites under different tabs.
So far in my searching, (which has be exhausting) I've come across VB code for older versions of VB, VB6 and everything else under the sun. So I finally find a site with people saying "I've got the answer" but their code only works with VB6 or something to that nature.

So this is what I've got so far with no clue what to do.

// declaring the function

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

//the portion of the code below fires when someone presses a button, but I don't have that code included, just the shellexecute code.
//trying to execute the function
ShellExecute(0&, "open", "http://www.gmail.com", vbNullString, "C:\", vbMaximizedFocus)

Now I get no errors, no nothing. Just simply nothing happens.
Any ideas, does anyone know how to use VB2008 ( which I believe is .net compatible) to open more than one website in the same explorer instance?
Thanks guys

Share this post


Link to post
Share on other sites
Advertisement
The .NET equivalent of Shell/ShellExecute is Process.Start.

Process.Start("http://example.com/")
Process.Start("http://gmail.com/")

should do the trick. Note that you will also have to configure IE correctly: under Tools, Internet Options, Tabs, Settings select Open links from other programs in: A new tab in the current window (the default).

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!