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: Gardar Taubar
Country: Italy
Language: English (Spanish)
Genre: Science
Published (Last): 24 January 2012
Pages: 242
PDF File Size: 2.6 Mb
ePub File Size: 4.15 Mb
ISBN: 480-4-20783-342-7
Downloads: 18267
Price: Free* [*Free Regsitration Required]
Uploader: Akinohn

If your application launches your own company’s games, you have to figure out a clever way to communicate paths.

Anyhow, what is the return value? ShellExecute Handle, ‘open’, PChar ‘c: This leads on to the fact that you should never call ShellExecute. ShellExecute Handle, sheellexecute, PChar ‘c: In this blog I have tried to cover all the ways. Can you be more specific please? ShellExecute Handle, ‘open’, PChar ‘command.

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

Note the added extra touch: ZIPthe fully commented source code delhpi for this project. If i use the code i wrote in my question without the parameter -lang rus- The application starts normally even if i put the Launcher outside the ”bin” folder with this comand: Open an HTML pagelocal or remote: There isnt any ”file not found” message. Sign up using Facebook. Sometime we need some special directories path from Microsoft Windows system to store User shelkexecute or to copy some files etc.


Use ShellExecuteEx when you need to get the shell to work out how to resolve a shell verb.

We can delete comments later. Also, I did address the issue of finding the absolute path.

You can get the unit in installed path C: Also i cannot have a full path bc ”C: What happens next, depends from the state of the “Wait for termination” checkbox: So Delphi provides so relphi easiest ways to send mail from our Delphi application. Sign up or log in Sign up using Google.

ShellExecute Handle, ‘print’, PChar ‘c: If your application is a general application launcher, you get the path from the user. Use CreateProcess to create processes.

Using Shell Execute in Delphi

So we can get those folder paths in Delphi in several ways. First use Excel unit to uses clause.

What happens next, depends from the state of the “Wait for termination” checkbox:. ShellExecute Handle, ‘print’, PChar ‘c: I can’t imagine why you neglected this. When i want to relocate the launcher outside this folder i use this command:.


In this blog I will describe how to read and write data from and to an Shlelexecute file. ShellExecute Handle, ‘open’, PChar ‘http: TObject ; var ExecuteResult: Syntax of Windows API function. If the checkbox is not checked, all the controls remain accessible, wether the external application is running or not.

You can find list of error codes at: There’s no point at all trying to persist with this.