Solved

VB6 - Open web ling with Firefox

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

623 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