+ Reply to Thread
Results 1 to 2 of 2

Thread: Open a service application on background to complete a task

  1. #1

    Open a service application on background to complete a task

    Sometimes , i would like to run an external application or some 3rd party application to complete a certain task
    How can i do that ?
    And also i'd like the main program to be suspended till the the other application finishes it's task.
    Last edited by csharpmaster; 10-31-2012 at 03:28 AM.

  2. #2
    For example : when a user hit the Paint button , it opens the paint application
    Code:
    ProcessStartInfo info = new ProcessStartInfo(@"C:\Windows\System32\mspaint.exe");
    info.UseShellExecute = false;
    info.RedirectStandardError = true;
    info.RedirectStandardInput = true;
    info.RedirectStandardOutput = true;
    // info.CreateNoWindow = true; // you can uncomment this if you want to run the app hidden
    info.ErrorDialog = false;
    //info.WindowStyle = ProcessWindowStyle.Hidden; // you can uncomment this if you want to run the app hidden
    
    Process process = Process.Start(info);
    process.WaitForExit();
    And once user closes the opened application the program will continue it`s routine.
    And in case it was a service program , once the program has done serving , it will close automatically and the program routine will be continued.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts