Get All Installed Mail Applications

Author: Smalig.

Mail Clients (OutLook Express for example) are stored in the Registry at
HKEY_LOCAL_MACHINE\Software\Clients\Mail.
So, you can simply check this key.

Preparations

Add 1 Command Button and 1 List Box to your form.

Module Code

Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" _
  (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Declare Function RegEnumKey Lib "advapi32.dll" Alias "RegEnumKeyA" (ByVal _
  hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, _
  ByVal cbName As Long) As Long
Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long

Public Const HKEY_LOCAL_MACHINE = &H80000002

Form Code

Private Sub Command1_Click()

    Dim sKey As String * 255
    Dim lRegKey As Long
    Dim iKey As Integer

    List1.Clear

    Call RegOpenKey(HKEY_LOCAL_MACHINE, "Software\Clients\Mail", lRegKey)

    While RegEnumKey(lRegKey, iKey, sKey, 255) = 0
        List1.AddItem Left(sKey, InStr(sKey, Chr(0)) - 1)
        iKey = iKey + 1
    Wend

    Call RegCloseKey(lRegKey)

End Sub 

Go Back