Hi, i want to know how i can start my c# program when another application is launched. I want only this application to start my program beacuse i will be doing some processing of the output from the application. The app was installed not written by me. I don't want to write a service.
Process.Start is what you are looking for
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start(VS.71).aspx
You may be able to use WMI in a second application that you create as seen here to monitor for the process you're looking for and then have your second 'monitor app' that is always running (not necessarily as a service) fire up your application to process the output of the application you want to have cause your app to run.
Other things we've done is have our app run from user login by adding it to the start up folder or by calling it from a scheduled task to look for data to process. Not sure what works for ya, but maybe some options you can make use of.
EDIT: @ManX IMO the monitor method works really well and I see no real problems processing thousands of reports per day in my apps using this method. I just look for new 'output' data, reports in your case in particular locations and process them accordingly. Typically our apps run in windowless mode, only being brought into the foreground whenever the user needs to interact. In your case this would be when a new report has been created. There are many facilities in the .NET framework that would allow you to write a flexible lightweight monitoring application.
Find one of the timers that suits you and periodically check for new reports. It will be an almost immediate reaction to the report creation and should be seamless for the user.
EDIT #2.
Look at creating a Permanent WMI event consumer... Then you can just use Process.Start
to fire up your app as others have recommended whenever you detect an event that you care about.
It looks like you want the launching of some outside app trigger the launching of your own app.
If you can control when the outside app starts, then you can make your own app start at the same time. What amounts to downright low-tech tech, for example, if that outside app can be launched using a batch file, simply include your app in the batch, e.g.
echo off
start OutsideApp.exe
MyOwnApp.exe
The command "start" fires off OutsideApp.exe and lets it run while executing the next instruction in the batch, MyOwnApp.exe.
But @WilP's response may be more what you're looking for. If it fits, though, mine is quicker to implement. :-)