Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/10/2017, 16:57
Avatar de haggenx
haggenx
 
Fecha de Ingreso: febrero-2007
Ubicación: México
Mensajes: 823
Antigüedad: 17 años, 2 meses
Puntos: 24
De acuerdo Aporte: ¿Cómo detectar que programa está asociado al protocolo mailto?

Les comparto este código para saber con que programa se va a abrir el comando mailto cuando por ejemplo hagamos clic en un enlace de correo en el navegador:

Public Function getMailtoApp() As String

Dim ret As Long, key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.ClassesRoot
Dim rtn As String = "", secondKey As String = ""

key = key.OpenSubKey("mailto\Shell\Open\Command")

If key IsNot Nothing Then

secondKey = key.GetValue("").ToString().Trim

If secondKey.IsNullOrEmpty(secondKey) = False Then

rtn = secondKey.Trim
rtn = System.Text.RegularExpressions.Regex.Match(rtn, "\""(.*?)\""").Groups(0).Value

End If

End If

rtn = rtn.Trim
If rtn.StartsWith(Chr(34)) = True Then rtn = rtn.Substring(1, rtn.Length - 1)
If rtn.EndsWith(Chr(34)) = True Then rtn = rtn.Substring(0, rtn.Length - 1)

Return rtn

End Function
__________________
Mi blog informático http://marjuanm.blogspot.mx
Fanpage del blog https://www.facebook.com/pages/Mis-p...36397183215592

Última edición por Malenko; 06/10/2017 a las 01:14