Solved

Simple Shell??? Question

Posted on 1998-09-27
2
197 Views
Last Modified: 2010-04-30
Hi!

I have a VERY simple question.
I have VB5

I want my program to open up the user's browser, and bring up a homepage.

Thing is, A. We don't know where the browser is, and B. Netscape or INternet Explorer?

I tried a couple of things:
x% = shell("http://whatever.com", Vbwhatever)
will bring up: filenotfound

x% = shell("c:\windows\explorer http://whatever.com", vbwhatever)
This will work, as long as you have IE 4...
I want it to work nomatter what

Please help :)
0
Comment
Question by:eversoslightly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
saam earned 10 total points
ID: 1436842
Option Explicit

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

Private Const SW_SHOW = 5
-------------------------------------------------------------------------------------------------------------------------------

'This will open the url: http://whatever in the system's default browser when the user clicks 'the button named Command1.
Private Sub Command1_Click()
    ShellExecute hwnd, "open", "http://whatever", vbNullString, vbNullString, SW_SHOW
End Sub

/saam
0
 
LVL 1

Author Comment

by:eversoslightly
ID: 1436843
Thanks!

Works great.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question