Solved

Executing other applications...

Posted on 1997-12-28
11
201 Views
Last Modified: 2010-04-04
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
0
Comment
Question by:MB122897
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 1

Expert Comment

by:anilms
ID: 1354797
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.


0
 

Author Comment

by:MB122897
ID: 1354798
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
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1354799
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:ZifNab
ID: 1354800
Forgot to mention, they tell you when execution is finished!
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1354801
Thanks, if you can send me the 32bit ver. My email is bosism@netvision.net.il

Matvey
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1354802
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...
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 1354803
I'm from Belgium. (be)

For answering the question :

Try the freeware component TExecfile for your purposes. It has realy good documentation and is very usefull for starting and ending all sorts of applications. It's on almost every component collection site.

Regards,
Zif.
0
 

Author Comment

by:MB122897
ID: 1354804
Thanks again

Could you tell me about some usefull sites ?

Matvey
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1354805
Sites for components?
0
 

Author Comment

by:MB122897
ID: 1354806
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
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question