Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Firefox instead of IE 2

Status
Not open for further replies.

kimtp

Programmer
Jun 15, 2002
310
US
The ShellExecute starts IE where I would prefer to use Firefox. Is that possible?

Here is my code:

Code:
Private Sub Form_Click()
 ShellExecute Me.hwnd, vbNullString, "[URL unfurl="true"]http://mywebpage",[/URL] vbNullString, "C:\", SW_SHOWNORMAL
End Sub

This is entered into a module:

Code:
Public 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

Public Const SW_SHOWNORMAL = 1

thanx.
 
Go into program access & defaults (Start | Set Program Access Defaults) where you can choose your default browser.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
When I run your code on my machine my default web browser (Mozilla) opens and loads the page specified. I think if you set Firefox to be the default web browser for Windows, it will open instead of IE. Basically, whatever browser opens when you click on an HTML document in Windows Explorer is what should open when you use ShellExecute.



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Thanx for the help. This places a program on the desktop and the program then makes the link. What I really want to do is to place an icon on the desktop and when the icon is clicked it jumps to the link.

Thanx for the help.

Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top