The easiest way to open a document, program or URL is to use the Windows API ShellExecute() function. Thanks to this function you can execute almost everything in Windows.
uses ShellAPI; ... (* sObject - (string) the program, document, URL, ... that you want to ** open. This can be: ** ** a document - 'C:\My Documents\Tips.txt' ** a program - 'notepad.exe' or 'C:\Program Files\WinRar\WinRar.exe' ** an URL - 'http://www.delphifaq.net/' ** an e-mail link - 'mailto: m3Rlin@delphifaq.net' ** ** E-Mail link: ** mailto: _e_mail_address_ ?Subject= _Subject_ &body= _e_mail_text_ ** &bcc= _blind_carbon_copy_addresses &cc= _carbon_copy_addresses ** ** If you want to add the &body= tag then remember to convert all the ** line ends (#13#10) to this sequence - %0A%0D *) ShellExecute(0, nil, PChar(sObject), nil, nil, SW_NORMAL);
Tags: bcc, blind carbon copy, body tag, c program, copy addresses, document c, document program, document url, e mail address, mail link, mail text, mailto, my documents, nil, notepad, program document, program files, shellexecute, windows api, winrar
Merlin’s Delphi Forge
Leave a comment