Solved

Executing other applications...

Posted on 1997-12-28
11
192 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

9 Experts available now in Live!

Get 1:1 Help Now