This code will use the system registry to get a list of the available mail clients on your system.

Add a listbox and command button to your project. Also add a module, then cut and paste the code below.

I thought I had 2 email clients, it turns out that I have 3. I didn't even realize that I had a HotMail client. Thanks Micorsoft!


==========Add to the module ===========================
Option Explicit

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

======= Add to Form1 ==================

Option Explicit

Public Sub ListMailClients(ListBox As ListBox)

Dim strKey As String * 255
Dim lngRegKey As Long
Dim intKey As Integer

ListBox.Clear

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

While RegEnumKey(lngRegKey, intKey, strKey, 255) = 0
ListBox.AddItem Left(strKey, InStr(strKey, Chr(0)) - 1)
intKey = intKey + 1
Wend

Call RegCloseKey(lngRegKey)

End Sub

Private Sub Command1_Click()
ListMailClients List1
End Sub