Friday, December 02, 2005

How to Open URL in Default Web Browser ?

Use the code below to Open a Default Program for the given file type
This program is in VB6
If you give any other filename with path instead of http://rahul.f2g.net then it will open that file in its default viewer/

[code]

'used for shelling out to the default web browser
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
Public Const conSwNormal = 1

ShellExecute hwnd, "open", "http://bagal.org", vbNullString, vbNullString, conSwNormal

[/code]

No comments:

Digg it !