Solved

VB6 - Open web ling with Firefox

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now