Link to home
Start Free TrialLog in
Avatar of Wilder1626
Wilder1626Flag for Canada

asked on

VB6 - Open web ling with Firefox

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

Avatar of Chris Watson
Chris Watson
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
What Chris said is correct to a point, you would need to query the registry first to see where firefox is installed.
Avatar of duncanb7
duncanb7

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
ASKER CERTIFIED SOLUTION
Avatar of Chris Watson
Chris Watson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wilder1626

ASKER

Thanks a lot for the help. This is working great.