Difference between Winexec and Shellexecute

Asked

Viewed 3,941 times

3

Good morning, you guys!

I have a personal question I haven’t found yet, so I come here.

What’s the difference between WinExec and ShellExecute at Delphi?

I ask this question because recently I had a problem trying to use the WinExec (tried to install a Windows service, but without success), but when using ShellExecute, the service was installed normally.

What does one have that the other doesn’t? I used Delphi 2010.

1 answer

3


The function ShellExecute works like Windows Run menu, and this is your best use benefit, the WinExec already in disuse with the successor CreateProcess.

WinExec performs a simple instruction from another application, an execmplo would open the Windows caculator by clicking on some button inside your application!

Already the ShellExecute is much more complex, it operates up a "file", an example would be you ask to print a particular file from your application! I believe you could install the service with the correct command line!

Documentation Winexec

Some details on Soen

More relevant details here.

Edit:

Inside the IDE’s Help you can browse the item Microsoft Windows Plataform SDK and get more details on the Shellexecute, this is not a navigation link, it only serves within Help

  • 1

    Brilliant! Thanks for the explanation Junior Moreira!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.