On Mon, 14 Feb 2005 14:35:48 -0800, "Darious Snell" <nu**@sdlkfweu. org> wrote:
¤ I need to be able to get the path to the users default browser from within my application.
¤
¤ I am in a situation where I can't easily use System.Diagnost ics.Process.Sta rt to start
¤ their browser with the URL I want and I must resort to using "Shell". Of course, shell
¤ wants to know where the browser is and now you can see my dilemma!
Give the following a try:
Declare Function FindExecutable Lib "shell32.dl l" Alias "FindExecutable A" (ByVal lpFile As
String, _
ByVal lpDirectory As
String, _
ByVal lpResult As
System.Text.Str ingBuilder) As Int32
Function DefaultBrowserP ath() As String
Dim DummyFile As String
Dim FileDir As String
Dim FilePath As New System.Text.Str ingBuilder(255)
DummyFile = "e:\My Documents\dummy .htm"
If FindExecutable( DummyFile, FileDir, FilePath) > 32 Then
DefaultBrowserP ath = FilePath.ToStri ng
End If
End Function
Paul ~~~
pc******@amerit ech.net
Microsoft MVP (Visual Basic)