0

Is there any way to get info like progress from another process?

What I'm trying to do is have Program1 download Program2, Program1 will then tell Program2 to do certain things and Program1 displays the progress.

If it's too tricky or difficult i could also just close program1 and move the interface to Program2 though, but I'd really prefer not to because it requires a lot of work.

  • It sounds as though the latter would be easier? – Bali C Jan 12 '12 at 09:27
  • See here: [Redirect console output to textbox in separate program C#](http://stackoverflow.com/q/415620) (Assuming Program2 is a console app) – George Duckett Jan 12 '12 at 09:28
  • possible duplicate of [Redirect console output to textbox in separate program C#](http://stackoverflow.com/questions/415620/redirect-console-output-to-textbox-in-separate-program-c-sharp) – George Duckett Jan 12 '12 at 09:29
  • Alright, well the program isn't a console so, I was just hoping that there was some way to do this without too much hassle like a few lines of code on both programs that allowed them to connect to eachother or something like that, but if there isn't such a thing as i feared, i'll just have to move the interface instead. Thanks anyways though –  Jan 12 '12 at 09:34

1 Answers1

2

Is there any way to get info like progress from another process?

There are lots of ways to do inter-process communication (IPC), including:

  • Redirected input/output.
  • Open socket
  • REST/WS-*
  • Shared Memory
  • Named Pipes
  • Events
  • Shared data file

and so forth. We would need a lot more details to be able to answer more specifically (eg. is one or other of Program1 and Program2 a GUI or console application). Also knowing why Program2 needs to be a separate program rather than an assembly loaded (ideally into a separate and restricted app domain) into the existing process?

Richard
  • 106,783
  • 21
  • 203
  • 265
  • Alright I'll go check those out, thanks, atleast now I know what to look for in google instead of random crap that leads to off topic results. –  Jan 12 '12 at 09:38
  • Richard if you can give more information on how to use Events to share information between one process to another . – Surjit Samra Jan 12 '12 at 09:43
  • 1
    @SurjitSamra A [Windows Event object](http://msdn.microsoft.com/en-us/library/ms682655(VS.85).aspx) allows a simple set/unset flag to be shared. **NB** don't use for mutual exclusion (then you want a mutex or critical section). – Richard Jan 12 '12 at 17:43