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.Diagnostics.Process.Start 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.dll" Alias "FindExecutableA" (ByVal lpFile As
String, _
ByVal lpDirectory As
String, _
ByVal lpResult As
System.Text.StringBuilder) As Int32
Function DefaultBrowserPath() As String
Dim DummyFile As String
Dim FileDir As String
Dim FilePath As New System.Text.StringBuilder(255)
DummyFile = "e:\My Documents\dummy.htm"
If FindExecutable(DummyFile, FileDir, FilePath) > 32 Then
DefaultBrowserPath = FilePath.ToString
End If
End Function
Paul ~~~
pc******@ameritech.net
Microsoft MVP (Visual Basic)