...get the start command for a installed Mail-Client?

Author: Marc Dürst
Homepage: http://www.idev.ch

Category: System

{
  Kommando ermitteln, mit welchem ein bestimmter,
  installierter Mail-Client gestartet werden kann.

  Get command to start a specific, installed Mail-Client.
}

uses
  
Registry;

function GetMailClientOpenCommand(AMailClient: string): string;
const
  
RegClientsRoot = '\SOFTWARE\Clients';
  RegClientsMail = '\Mail';
  RegClientsOpenCmd = '\shell\open\command';
var
  
reg: TRegistry;
begin
  
Result := '';
  reg := TRegistry.Create;
  try
    with 
reg do
    begin
      
CloseKey;
      RootKey := HKEY_LOCAL_MACHINE;
      if OpenKeyReadOnly(RegClientsroot + RegClientsMail +
        '\' + AMailClient +
        RegClientsOpenCmd) then
        
Result := reg.ReadString('');
    end;
  finally
    if 
Assigned(reg) then reg.Free;
  end;
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base