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: Kajigor Akinonos
Country: Iran
Language: English (Spanish)
Genre: Video
Published (Last): 11 July 2006
Pages: 256
PDF File Size: 11.15 Mb
ePub File Size: 18.8 Mb
ISBN: 757-1-12031-273-2
Downloads: 97637
Price: Free* [*Free Regsitration Required]
Uploader: Gardak

Delphi 7 – ShellExecute command not working in situations Ask Question. Use ShellExecuteEx when you need to get the shell to work out how to resolve a shell verb. First use Excel unit to uses clause.

It gives some degree of control, and at the same time it’s not too complicated. ShellExecute Handle, ‘open’, PChar ‘command. Can I print documents from within my program, without explicitly starting the application that created the document, such as: Clicking the first button will launch the external application that is specified in the first edit-box.

If the checkbox is not checked, all the controls remain accessible, wether the external application is running or not. Try passing the executable’s directory in the lpDirectory parameter to ShellExecute. For instance, if you know that the path is C: FileName, link URL to open and modify. The Game Launches and the language is in russian if i put ‘-lang eng’ it still works fine and the game is in english.


Note the added extra touch: Also i cannot have a full path bc ”C: ShellExecute Handle, ‘open’, PChar ‘command.

Using Shell Execute in Delphi – Azulia Designs

Open an HTML pagelocal or remote: This leads on to the fact that you should never call ShellExecute. 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: EXE file is invalid non-Win If the checkbox is checked, the demo will wait for the completion of the external program.

Felphi course, you have read the ShellExecute documentation carefully, so you know what the return values are. ZIPthe fully commented source code files for this project.

Also the title bar changes to “Waiting for completion of ShellExecute Handle, ‘open’, PChar ‘c: A handle to the parent window used for displaying a UI or error messages.

But I didn’t say so, either. Post Your Answer Discard 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. People have been asking me over and over: The specified dynamic-link library was not found.

How to surf to a site, i. Email Required, but never shown. What happens next, depends from the state of the “Wait for termination” checkbox: Also, I did address the issue of finding the absolute path. There’s no point writing code that doesn’t deal with errors. But it will not work with attachment for every mail client. AndreasRejbrand Actually, ShellExecute is basically useless when it comes to reporting errors. Anyhow, what is the return value? What should i change? How to open my browser with a local HTML page?


Using Shell Execute in Delphi

The ‘return value’ is shelleexecute value returned by the function. If I have left something please feel free to add comments.

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

You should use fully-qualified paths. And when you click on one of the underlined labels, an HTML file will be loaded in your browser: If the window is minimized or maximized, Windows restores it to its original size and position.

It is trivially easy to launch your process.

ShellExecute in Delphi

You can find list of error codes sshellexecute Can you be more specific please? If your application launches your own company’s games, you have to figure out a clever way to communicate paths. Did you try starter.