Board index » delphi » Launching Other Applications from within Delphi?

Launching Other Applications from within Delphi?

I need to be able to launch other applications (eg Microsoft Word) from
within Delphi.... Any ideas?

Any help much appreciated.

Sean.

 

Re:Launching Other Applications from within Delphi?


"Steve Durkin" <sean.d...@btopenworld.com> schreef in bericht
news:au1h5q$5s7$1@venus.btinternet.com...

Quote
> I need to be able to launch other applications (eg Microsoft Word) from
> within Delphi.... Any ideas?

> Any help much appreciated.

> Sean.

uses ShellAPI;

ShellExecute(handle, 'open', 'MyFile.doc', nil, nil, SW_ShowNormal);

Alfred.

Re:Launching Other Applications from within Delphi?


Thanks for your help!!

Re:Launching Other Applications from within Delphi?


Sorry - Just one more question: when I change

'ShellExecute(handle, 'open', 'MyFile.doc', nil, nil, SW_ShowNormal);'

to:

ShellExecute(handle, 'open', 'MyPlaylist.pls', nil, nil, SW_ShowNormal);

it doens't work... As far as I can tell, nothing happens. Does this bit of
code not work with some file extensions? Is there an alternative bit of code
that will?

Re:Launching Other Applications from within Delphi?


Quote
Steve Durkin wrote in message ...
>I need to be able to launch other applications (eg Microsoft Word) from
>within Delphi.... Any ideas?

Read the miniFAQ.

http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm

Groetjes,
Maarten Wiltink

Re:Launching Other Applications from within Delphi?


"Steve Durkin" <sean.d...@btopenworld.com> schreef in bericht
news:au2adn$oum$1@knossos.btinternet.com...

Quote
> Sorry - Just one more question: when I change

> 'ShellExecute(handle, 'open', 'MyFile.doc', nil, nil, SW_ShowNormal);'

> to:

> ShellExecute(handle, 'open', 'MyPlaylist.pls', nil, nil, SW_ShowNormal);

> it doens't work... As far as I can tell, nothing happens. Does this bit of
> code not work with some file extensions? Is there an alternative bit of
code
> that will?

Works only if *.pls files are registred in windows, to open with a program
that can read that kind of files.
Otherwise use:
ShellExecute(handle, 'open', 'TheApp', 'MyPlaylist.pls', nil, SW_ShowNormal)

Lookup ShellExecute in the online-help.

Alfred.

Re:Launching Other Applications from within Delphi?


Quote
"Steve Durkin" <sean.d...@btopenworld.com> wrote in message

news:au1h5q$5s7$1@venus.btinternet.com...

Quote
> I need to be able to launch other applications (eg Microsoft Word) from
> within Delphi.... Any ideas?

In addition to ShellExecute there is ShellExecuteEx and CreateProcess. For
COM applications, such as MS Word, one can also consider using a COM object,
see http://www.djpate.freeserve.co.uk/Automation.htm, which allows the
caller to control the called program.

Re:Launching Other Applications from within Delphi?


Thanks everyone thats exactly what I'm looking for!

Re:Launching Other Applications from within Delphi?


"Bruce Roberts" <b...@bounceitattcanada.xnet> wrote in
news:NebN9.21756$H67.98077@tor-nn1.netcom.ca:

Quote
> In addition to ShellExecute there is ShellExecuteEx

I use the freebie Delphi 6 personal version.

If I put ShellExecute or ShellExecuteEx in either the index or find
boxes of Delphi help I get ...  nothing.

Are these commands missing from "freebie" Delphi or it it me goofing
up again?

--
Kate Martin

Re:Launching Other Applications from within Delphi?


"Kate Martin" <86yst...@sneakemail.com> schreef in bericht
news:Xns92EDE1E37D8Epooobahh5386@127.0.0.1...

Quote
> "Bruce Roberts" <b...@bounceitattcanada.xnet> wrote in
> news:NebN9.21756$H67.98077@tor-nn1.netcom.ca:

> > In addition to ShellExecute there is ShellExecuteEx

> I use the freebie Delphi 6 personal version.

> If I put ShellExecute or ShellExecuteEx in either the index or find
> boxes of Delphi help I get ...  nothing.

> Are these commands missing from "freebie" Delphi or it it me goofing
> up again?

> --
> Kate Martin

Win32.hlp

Alfred.

Re:Launching Other Applications from within Delphi?


Quote
Kate Martin <86yst...@sneakemail.com> wrote in message ...
>"Bruce Roberts" <b...@bounceitattcanada.xnet> wrote in
>news:NebN9.21756$H67.98077@tor-nn1.netcom.ca:

>> In addition to ShellExecute there is ShellExecuteEx

>I use the freebie Delphi 6 personal version.

>If I put ShellExecute or ShellExecuteEx in either the index or find
>boxes of Delphi help I get ...  nothing.

>Are these commands missing from "freebie" Delphi or it it me goofing
>up again?

This is a limitation of the help system. You can only open
one help file at a time, and it tends to be the VCL help file.
ShellExecute isn't in that, of course.

But "Type ShellExecute, press F1" searches through every help
file registered with Delphi. Including the win32 help file,
where it is.

Groetjes,
Maarten Wiltink

Re:Launching Other Applications from within Delphi?


"Maarten Wiltink" <maar...@kittensandcats.net> wrote in
news:3e07806f$0$153$e4fe514c@news.xs4all.nl:

Quote
> Kate Martin <86yst...@sneakemail.com> wrote in message ...
>>I use the freebie Delphi 6 personal version.
>>If I put ShellExecute or ShellExecuteEx in either the index or
>>find boxes of Delphi help I get ...  nothing.
> This is a limitation of the help system. You can only open
> one help file at a time, and it tends to be the VCL help file.
> ShellExecute isn't in that, of course.
> But "Type ShellExecute, press F1" searches through every help
> file registered with Delphi. Including the win32 help file,
> where it is.

I am new to Delphi. (I have been very disappointed with the help
system in Delphi. I find it difficult to learn anything using help.)
I am clearly missing something here.

If I type "ShellExecute" into the edit window and press F1, the help
system opens, the index tab is in front, the top edit box titled "1
Type the first few letters of the word you're looking for" contains
the word "ShellExecute" and it is highlighted. The list box beneath
that has "ShareMem" at the top, then "sharing project files"
(highlighted), then shl, and so on. ShellExecute is not in the list.

Any idea what I am doing wrong?
I think I have misunderstood something.

(I have found "ShellExecute macro" in
E:\Program Files\Borland\Delphi6\Help\Tools\HCW.HLP but I can find no
way to get to this help from within Delphi.)

I have this {*word*193} feeling that I am doing something really stupid.

--
Kate Martin

Re:Launching Other Applications from within Delphi?


On Tue, 24 Dec 2002 15:15:32 +1050, Kate Martin

Quote
<86yst...@sneakemail.com> wrote:
>I am clearly missing something here. <

That's the "problem" of the free Delphi-Versions, they have
limitations which can make it difficult to work with them.

Quote
>I think I have misunderstood something.<

No, you haven't. You did it right, but the "Shellexecute"-function is
not explained in the Help-File, that opens on the "F1-Key".

I do not know your Delphi-Installation but maybe you can try this way
(especially for your actual problem):
First locate the file "Win32s.hlp" on your Computer. Then you can
execute this file directly in its directory by double-clicking on it.
When you then use the "Index-" or the "Find-"Tab, it should leads you
to the Explanation to the "Shellexecute"-Function.

Quote
>I have this {*word*193} feeling that I am doing something really stupid.<

I don't think so - you just learn Delphi on the hard way, which is, as
I think, sometimes the better way :-)

Gerd-Ulrich Meyer

PS: Please don't look to serious on my English - I'm german.

Re:Launching Other Applications from within Delphi?


Gerd-Ulrich Meyer <g-u.me...@gmx.de> wrote in
news:ef6g0v89idaqht66l86eoodh7bp8o10m25@4ax.com:

Quote
> On Tue, 24 Dec 2002 15:15:32 +1050, Kate Martin
> <86yst...@sneakemail.com> wrote:
>>I am clearly missing something here. <
> That's the "problem" of the free Delphi-Versions, they have
> limitations which can make it difficult to work with them.

One would expect the "help" to be better if anything. I am assuming
the rational behind providing free versions is to encourage people
(like me) that have never used Delphi before to start learning it.
"Help" should be doubly good in that situation.

Quote
>>I think I have misunderstood something.<
> No, you haven't. You did it right, but the "Shellexecute"-function
> is not explained in the Help-File, that opens on the "F1-Key".

Ahh...

Quote
> I do not know your Delphi-Installation but maybe you can try this
> way (especially for your actual problem):
> First locate the file "Win32s.hlp" on your Computer. Then you can
> execute this file directly in its directory by double-clicking on
> it. When you then use the "Index-" or the "Find-"Tab, it should
> leads you to the Explanation to the "Shellexecute"-Function.

Brilliant! Thank you. I have now found a whole bunch of help files I
didn't even know were there. :) Tucked away in a completely different
directory branch...
E:\Program Files\Common Files\Borland Shared\MSHelp

It is a pity I have to find these from outside Delphi. (It makes it
hard to know where to look.)

Quote
>>I have this {*word*193} feeling that I am doing something really
>>stupid.<
> I don't think so - you just learn Delphi on the hard way, which
> is, as I think, sometimes the better way :-)

Indeed! That's how I learn most computer stuff. Sometimes takes
longer, and you go round and round in circles with something
silly/easy, but when you find the answer you tend to remember. With
Delphi, I just installed and started "playing around". I had my first
"hello world" up and running in about 5 mins. It was so easy, I fell
in love with Delphi immediately.

Quote
> PS: Please don't look to serious on my English - I'm german.

Your english is great. I never would have picked it was not your
native tongue.

Thanks again... very much appreciated.

--
Kate Martin

Re:Launching Other Applications from within Delphi?


On Wed, 25 Dec 2002 01:22:00 +1050, Kate Martin

Quote
<86yst...@sneakemail.com> wrote:
>Brilliant! Thank you. I have now found a whole bunch of help files I
>didn't even know were there. :) Tucked away in a completely different
>directory branch...
>E:\Program Files\Common Files\Borland Shared\MSHelp<<

Ok, I didn't know the exact situation on your Computer (Directory,
OS,...)  Otherwise I have told you this, but as I have 2 Versions of
Delphi on my System (D5 and D6) I wasn't sure, what it will be on a
"single D6-System".

Quote
> It was so easy, I fell
>in love with Delphi immediately.<

Let's hope, this love will go on :-))

Quote
>Your english is great.<

Thank you! It's just the english, i learned at school for 3 years and
during 1 three-weeks holiday in England.

Gerd-Ulrich Meyer

Go to page: [1] [2]

Other Threads