Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating browser or email links.

Status
Not open for further replies.

MinalMoe

IS-IT--Management
Mar 25, 2004
62
GB
I am using Delphi 7.

Is there any way that when I insert email addresses or URLs in a field that a jump can be made either to an external email program to start an email, or to an external browser to link to that URL.

Thanks for any help.
 
Look up ShellExecute. Typically if you run a command that starts with mailto: you will invoke a new e-mail.
 
Here's part of what I've been using, should help you some.

Code:
    var
      SEinfo: TShellExecuteInfo;
      startinstring: String;
      CreateOK: Boolean;
      ErrorCode: DWord;
    begin
      ErrorCode := 0;
      startinstring := '';
      FillChar(SEInfo, SizeOf(SEInfo), 0) ;
      SEInfo.cbSize := SizeOf(TShellExecuteInfo);
      with SEInfo do
        begin
          fMask := SEE_MASK_NOCLOSEPROCESS;
          lpFile := PChar(ExecuteFile) ;
          lpParameters := PChar(ParamString) ;
          lpDirectory := PChar(StartInString) ;
          nShow := SW_SHOWNORMAL;
        end;
      CreateOK := ShellExecuteEx(@SEInfo);
      WaitForInputIdle(SEInfo.hProcess, INFINITE);
      if CreateOK then
         procid := SEInfo.hProcess;
      GetExitCodeProcess(SeInfo.hProcess, ErrorCode);
    end;

----------
Measurement is not management.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top