Link to home
Start Free TrialLog in
Avatar of MB122897
MB122897

asked on

Executing other applications...

Hi

I need to execute other application within my code.
The application does smth and then I have to close It.

So, How?

Please help

Matvey
Avatar of anilms
anilms

The code for executing another application from within one application is straightforward :

WinExec('Application',1);

Suppose you want to execute the Windows Calculator :

WinExec('Calc.Exe',1);

The 1 is to indicate a normal application state. If you have a 0 instead of 1, it will just open and close the application without doing anytthing. The second parameter in the WinExec command is the state in which the new application should be executed. The first parameter is the application name within quotes. Be sure to include the full path if the application is not in the local directory or the system search path.


Avatar of MB122897

ASKER

Well, let's say that I want to execute smth like the win sound recorder with a wav file as a parameter .This one closes itself when it finishes playing, but I also have to know when it closes. But my application doesn't closes when finishes doing what it has to do.
So first of all I need a sugestin how to know when it finishes (if it's important - the application plays a sort of file), and when it does I have to close it.
I think it's really not simple, I just don't have more points to give you.

Matvey
Hi MB,

For this I usually use a freeware component, which I find great and has a really good documentation, I suggest that you first have a look at it and then tell if it's what you're looking for are not.

It's called TExecFile and you can find it at :

 Heck, I don't know it anymore, but I have the zip-files. So if you want them I can send you them by email (16, 32 bit versions)

This is another, which I haven't tried out yet :

 torry.rimini.com/vcl/system/sfexec.zip

Regards,
Zif.

And I think, you sure DON'T have to give more points.
Forgot to mention, they tell you when execution is finished!
Thanks, if you can send me the 32bit ver. My email is bosism@netvision.net.il

Matvey
Oh, I realy thank you for that thing, it's realy useful and it's exactly what I need (the other one is less powerfull).
I've already thought of a way to know when I have to close it...

And to answer your question - 'il' is for 'Israel'.
Where do you live ?

Thank you, and I'd like to give you those points...
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks again

Could you tell me about some usefull sites ?

Matvey
Sites for components?
Yes, and other usefull programming stuff.
I can tell now about one I remember (maybe it was even you that gave me (or someone else) this shortcut, I don't remember...):

http://web.access.net.au/%7Egchandle/

It has some links and pakages for download...

If it's not a problem then send me some shortcuts.
I'll try to find smth interesting for you...

Thanks, Matvey