There are several ways of executing files and applications from Delphi. All use the ShellAPI unit and either the ShellExecute or ShellExecuteEx. Launch files and programs from your code using Delphi. ShellExecute is Delphi Windows API function that is mostly used for launch external applications from our Delphi application. This function is.

Author: Kazralmaran Mazusho
Country: Italy
Language: English (Spanish)
Genre: Personal Growth
Published (Last): 15 January 2009
Pages: 433
PDF File Size: 11.92 Mb
ePub File Size: 14.67 Mb
ISBN: 681-1-66268-219-2
Downloads: 85732
Price: Free* [*Free Regsitration Required]
Uploader: Vorn

Delphi Tutorial: Running an external application w ShellExecute

ShellExecute in Delphi — Launch external applications. By using ShellExecute we can also do following operations Syntax of Windows API function. A handle to the parent window used for displaying a UI or error messages.

FileName, link URL to open and modify. EX – PChar filename. The active window remains active. If the window is minimized or maximized, Windows restores it to its original size and position.

If the return value of ShellExecute is greater than 32, the application was executed successfully. There was not enough memory to complete the operation.


EXE file is invalid non-Win EXE or error in. The specified dynamic-link library was not found.

In order to use the function, you first need to add the ShellApi to your uses clause, like: ShellExecute Handle, ‘open’, PChar ‘c: ShellExecute Handle, ‘print’, PChar ‘c: Open an HTML page, local or sheplexecute ShellExecute Handle, ‘open’, PChar ‘http: ShellExecute Handle, ‘explore’, PChar ‘c: ShellExecute Handle, ‘open’, PChar ‘command. Sometime we need some special directories path from Microsoft Windows system to store User data or to copy some files etc.

So we can get those folder paths in Delphi in several ways.

In this blog I have tried to cover all the ways. If I have left something please feel free to add comments. In this blog I will describe how to read and write data from and to an Excel file.

Delphi 7 – ShellExecute command not working in situations – Stack Overflow

For this Excel or later should have installed in our system. First use Excel unit to uses clause. This unit comes with Delphi installation it self. You can get the unit in installed path C: So what it LCID? Today in most of software program it is required to send mail to others with attached data.


As some time we need to update clients deophi their account details, status celphi any other information through mail. So Delphi provides so many easiest ways to send mail from our Delphi application.

I have collected some of ways which are very useful for Delphi developers. In Delphi we don’t required any third party components to send mails. So here are the ways ShellExecute Sends Email using default mail client software relphi on user’s system.

But it will not work with attachment for every mail client.

Back to top