Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Standard E-Mail Client ermitteln? (https://www.delphipraxis.net/14831-standard-e-mail-client-ermitteln.html)

max666 16. Jan 2004 15:27


Standard E-Mail Client ermitteln?
 
Hallo!

Weiß jemand, wie man den standard E-Mail Client auf einem Rechner ermitteln und starten kann.
Ich habe folgende Funktion im Internet gefunden. Da die Funktion WinExec benutzt, läuft die Funktion auf meinem Windows XP Rechner nicht. Und scheinbar bin ich zu blöd, ShellExecute oder ShellExecuteEx anzuwenden.

Delphi-Quellcode:
procedure OpenMailClient;
const
  cMailClient = '\SOFTWARE\Clients\Mail\';
var
  reg: TRegistry;
  RegClientDefault: string;
  handle: thandle;
begin
  reg := TRegistry.Create;
  try
    with reg do
    begin
      CloseKey;
      RootKey := HKEY_LOCAL_MACHINE;
      if OpenKeyReadOnly(cMailClient) then RegClientDefault := reg.ReadString('');
      if OpenKeyReadOnly(cMailClient + RegClientDefault + '\shell\open\command') then
      WinExec(PChar(ReadString('')), SW_SHOWNORMAL);
    end;
  finally
    reg.Free;
  end;
end;
Hat jemand eine Idee!

Gruß aus dem Emsland
max666

Alexander 16. Jan 2004 15:53

Re: Standard E-Mail Client ermitteln?
 
Probier es mal damit:
Delphi-Quellcode:
ShellExecute(Form1.Handle, 'open', PChar('mailto:test@tt.de'), nil, nil, SW_SHOWNORMAL);

max666 16. Jan 2004 16:23

Re: Standard E-Mail Client ermitteln?
 
Hallo!

Jo, es läuft perfekt! Und einfacher als ich dachte.

Gruß
max666


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:17 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz