?
Solved

Open default browser in Windows XP using API??

Posted on 2003-03-14
7
Medium Priority
?
140 Views
Last Modified: 2010-05-01
Does anyone know how I can open the default browser in Windows XP??
The following code worked in Windows 2000, but not in XP, any ideas???

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

Dim l As Long
l = ShellExecute(0, vbNullString, "blank.html", vbNullString, vbNullString, vbNormal)
0
Comment
Question by:simon780
[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
  • 4
  • 2
7 Comments
 
LVL 10

Expert Comment

by:aeklund
ID: 8136803
Try this:

l = ShellExecute(0, "open", "blank.html", vbNullString, vbNullString, vbNormal)
0
 

Author Comment

by:simon780
ID: 8137431
aeklund
It didn't work, thanks anyway
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8137503
a liitle modification:

Try this:

l = ShellExecute(0, "open", "about:blank", vbNullString, vbNullString, vbNormal)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8137524
i did a test and it works on 2000/XP
0
 

Author Comment

by:simon780
ID: 8138221
to Richie_Simonetti

Thx it works!!!
but it doesn't work with the URL....

l = ShellExecute(0, "open", "http://yahoo.com", vbNullString, vbNullString, vbNormal)

it doesn't work, the browser doesn't come up

any solutions??? thx!!
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 8138522
i have no problems with this:
Dim l As Long
l = ShellExecute(0, "open", "http://www.yahoo.com", vbNullString, vbNullString, vbNormal)
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8231781
Simon780, i WILL remember you.
Cheers
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

762 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