Solved

VB6 - Open web ling with Firefox

Posted on 2014-07-23
5
244 Views
Last Modified: 2014-07-25
Hi.

I would like to know how i can force the web link to open with Firefox and still leave IE as the default browser.

Is that possible?

Thanks for your help

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

    ShellExecute Me.hwnd, vbNullString, _
                 "www.google.ca", _
                 vbNullString, App.Path, SW_SHOWNORMAL

Open in new window

0
Comment
Question by:Wilder1626
[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
5 Comments
 
LVL 4

Expert Comment

by:Chris Watson
ID: 40214530
Shell "C:\Program Files (x86)\Mozilla Firefox\Firefox.exe ""http://www.google.ca""", vbNormalFocus 

Open in new window


Provided that Firefox is installed in the standard location on a 64-bit PC this will open http://www.google.ca in Firefox without requiring changing the default browser. If Firefox is installed in a different location, update the path accordingly.
0
 
LVL 21

Expert Comment

by:Randy Poole
ID: 40214536
What Chris said is correct to a point, you would need to query the registry first to see where firefox is installed.
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40214562
it seems he want to get the handler of hwnd from firefox application as we did it for IE

Author, please  write more about this if it is

Duncan
0
 
LVL 4

Accepted Solution

by:
Chris Watson earned 500 total points
ID: 40214792
I like Randy's suggestion for improving the robustness of the strategy.

It seems that the location of the Firefox executable is stored in the registry. The correct key is dependant upon a few things, including the version number of Firefox installed and the version of Windows in use.

For example, for Firefox 30 on Windows 7 (64-bit) the registry path is:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\30.0 (en-GB)\Main\PathToExe

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 40219266
Thanks a lot for the help. This is working great.
0

Featured Post

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!

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

730 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