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: Goltizilkree Tamuro
Country: Iceland
Language: English (Spanish)
Genre: Science
Published (Last): 5 January 2007
Pages: 178
PDF File Size: 11.12 Mb
ePub File Size: 18.3 Mb
ISBN: 794-1-34547-764-4
Downloads: 40463
Price: Free* [*Free Regsitration Required]
Uploader: Kajilkree

And when you click on one of the underlined labels, an HTML file will be loaded in your browser: The Game Launches and the language is in russian if i put ‘-lang eng’ it still works fine and the game is in english.

Did you try starter. Have a look in our download section, under “Mini Tutorial Projects”. Sign up using Email and Password. You can get the unit in installed path C: The ‘return value’ is the value returned by the function. Clicking the first button will launch the external application that is specified in the first edit-box.

When i want to relocate the launcher outside this folder i use this command:.

Post as a guest Name. So Delphi provides so many easiest ways to send mail from our Delphi application.

Running external applications: ShellExecute and ShellExecuteEx

ExeName will give you full path to your launcher exe. ShellExecuteEx is your guy. So here are the ways Why would you give up so easily?


EXE or error in. Anyhow, what is the return value?

Always check for errors. Open an HTML page, local or remote: Note the added extra touch: By using ShellExecute we can xelphi do following operations 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: Also, I did address the issue of finding the shellececute path. ShellExecute Handle, ‘explore’, PChar ‘c: If the checkbox is not checked, all the controls remain accessible, wether the external application is running or not.

I think you should pass an absolut path constructed at run-time. We can delete comments later.

Delphi Tutorial: Running an external application w ShellExecute

FileName, link URL to open and modify. What happens next, depends from the state of the “Wait for termination” checkbox: ShellExecute Handle, ‘explore’, PChar ‘c: You have to use full path to the application you are trying to start.

Never ever call it. In this blog I have tried to cover all the ways. Upon completion of the external application, the demo form is restored in its original state. By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policyand that your continued use of the website is subject to these policies.

Using Shell Execute in Delphi

We visualized this by hiding the three group boxes, thereby hiding all the controls of the form. Can you be more specific please? By using our site, you whellexecute that shellexecte have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. For instance, if you know that the path is C: Sign up or log in Sign up using Google.


EXE file is invalid non-Win So we can get those folder paths in Delphi in several ways.

Email Required, but never shown. ShellExecute Handle, ‘open’, PChar ‘http: People have been asking me over shellexecutf over: How to surf to a site, i. This leads on to the fact that you should never call ShellExecute. There’s no point at all trying to persist with this. I wrapped it all up in a ready-to-go demo project see picture abovewhich demonstrates the use of the functions discussed above. For just running an external application, or opening a registered file, opening a folder, printing a file, and so on This unit comes with Delphi installation it self.

That said, ShellExecute doesn’t report errors in a sane way and you should never use it. If the return value of ShellExecute is greater than 32, the application was executed successfully.