Hi, das geht so:
Visual Basic: [code]Public Function Reg_Read(hkeypath As String) As String
On Error Resume Next
Dim ObjRead
Set ObjRead = CreateObject("wscript.shell")
Reg_Read = ObjRead.RegRead(hkeypath)
If Reg_Read = "" Or Reg_Read = hkeypath Then
Reg_Read = "Not Found"
End If
Exit Function
End Function
Public Function DefaultBrowser()
Dim RegEntry As String
Regentry = Reg_Read("HKEY_CLASSES_ROOTHTTPshellopencommand")
Regentry = Replace(Regentry, Chr(34), "")
Regentry = Mid(Regentry, 1, InStr(1, LCase(Regentry), ".exe") + 3)
If Regentry = "" Then Regentry = "-"
DefaultBrowser = RemovePath(Regentry)
End Function
Function RemovePath(sFullPath As String) As String
Dim nLastSlash As Integer
nLastSlash = InStrRev(sFullPath, "")
If (nLastSlash > 0) Then
RemovePath = Right(sFullPath, Len(sFullPath) - nLastSlash)
Else
RemovePath = sFullPath
End If
End Function
[/code]
Verwendung:
MsgBox DefaultBrowser
Beispielprojekt ist im Anhang!