Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. C# 2.0 Process.Start

C# 2.0 Process.Start

Scheduled Pinned Locked Moved C#
csharp
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kselman
    wrote on last edited by
    #1

    I have an app that launches another app. I dont want to return out of my function until the second app has exited. So Im using a while loop. But the first application needs repainting if you move the second app around on the screen. When I call invalidate in each pass it cleans up the garbage but does not draw controls. I see place holders of where buttons and other controls should be. ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "InstallIDS.exe"; Process process = Process.Start(startInfo); while (!process.HasExited) { Thread.Sleep(500); this.Invalidate(true); }

    N 1 Reply Last reply
    0
    • K kselman

      I have an app that launches another app. I dont want to return out of my function until the second app has exited. So Im using a while loop. But the first application needs repainting if you move the second app around on the screen. When I call invalidate in each pass it cleans up the garbage but does not draw controls. I see place holders of where buttons and other controls should be. ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "InstallIDS.exe"; Process process = Process.Start(startInfo); while (!process.HasExited) { Thread.Sleep(500); this.Invalidate(true); }

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      You need to start the second process within a seperate thread for the first to remain responsive. I would question why you need to design it this way though. Are there other actions taht the user can be doing while the second process is running? Perhaps starting the second process in a hidden window would work for you.


      only two letters away from being an asset

      K 1 Reply Last reply
      0
      • N Not Active

        You need to start the second process within a seperate thread for the first to remain responsive. I would question why you need to design it this way though. Are there other actions taht the user can be doing while the second process is running? Perhaps starting the second process in a hidden window would work for you.


        only two letters away from being an asset

        K Offline
        K Offline
        kselman
        wrote on last edited by
        #3

        Thanks for the reply. I dont want the user to interact with the first process while the second process is running. I have a function that disables all the controls. So I think I will use that with a new thread. I was hoping to let the parent form look responsive even though they couldnt do anything until the 2nd process was done. Its and application that launches installers and it also can delete files.. so I dont want them clicking on a button that could delete parts of something that their currently installing..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups