;=============================================================================== ; Function Name: _LaunchDefaultMailClient() ; Description: Open default mail client ; Parameter(s): None ; Requirement(s): None ; Return Value(s): On Success - Process ID of e-mail client ; On Failure - Returns: ; 1-Reading of the registry Failed ; 2-Getting the Path Of the Default Mail Client Failed ; 3-Run Failed ; Author(s): Brett Francis ; Thanks: GaryFrost ; Zedna ; MrCreator ; Note(s): For Some reason, Wont work for Opera. Will Update Soon. ;=============================================================================== ; Func _LaunchDefaultMailClient() Local $Old_Opt_EES = Opt("ExpandEnvStrings", 1) Local $iRetError = 0, $iRetValue = 0 Local $ReadDefMailClient, $ReadCommand $ReadDefMailClient = RegRead("HKLM\SOFTWARE\Clients\Mail", "") If @error Or $ReadDefMailClient = "" Then $iRetError = 1 If $iRetError = 0 Then $ReadCommand = RegRead("HKLM\SOFTWARE\Clients\Mail\" & $ReadDefMailClient & "\shell\open\command", "") If @error Or $ReadCommand = "" Then $iRetError = 2 EndIf If $iRetError = 0 Then If StringRegExp($ReadCommand, '"(.*)"') Then _ $ReadCommand = StringMid($ReadCommand, 2, StringInStr($ReadCommand, '"', 0, 2) - 2) If StringInStr($ReadCommand, '/') Then _ $ReadCommand = StringLeft($ReadCommand, StringInStr($ReadCommand, '/', 0, -1)) EndIf If $iRetError = 0 Then $ReadCommand = StringStripWS($ReadCommand, 3) If Not FileExists($ReadCommand) Then $iRetError = 3 EndIf If $iRetError = 0 Then Local $iRetValue = Run($ReadCommand) If @error Then $iRetError = 4 EndIf Opt("ExpandEnvStrings", $Old_Opt_EES) Return SetError($iRetError, 0, $iRetValue) EndFunc ;==>_LaunchDefaultMailClient