Solved

Executing other applications...

Posted on 1997-12-28
11
193 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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
 
LVL 8

Expert Comment

by:ZifNab
ID: 1354807
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
TVirtualStringTree  search using TEdit 7 103
Delphi - replicating a form 8 62
Comparing dates in Delphi. Greater than/ Less than 3 110
Find and Replace Stream with 0s 8 56
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
A short film showing how OnPage and Connectwise integration works.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

930 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now