Solved

VB6 - Open web ling with Firefox

Posted on 2014-07-23
5
245 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

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

734 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