Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: Serialize only 1 field: Panel Pin
Heath Stewart23-Sep-03 6:43
protectorHeath Stewart23-Sep-03 6:43 
GeneralRe: Serialize only 1 field: Panel Pin
pahluwalia23-Sep-03 6:55
pahluwalia23-Sep-03 6:55 
GeneralRe: Serialize only 1 field: Panel Pin
Heath Stewart23-Sep-03 8:31
protectorHeath Stewart23-Sep-03 8:31 
GeneralReceiving Input from other processes/OS (aka Standard In) Pin
AJB...23-Sep-03 5:13
AJB...23-Sep-03 5:13 
GeneralRe: Receiving Input from other processes/OS (aka Standard In) Pin
Heath Stewart23-Sep-03 5:55
protectorHeath Stewart23-Sep-03 5:55 
GeneralRe: Receiving Input from other processes/OS (aka Standard In) Pin
Blake Coverett23-Sep-03 6:51
Blake Coverett23-Sep-03 6:51 
GeneralRe: Receiving Input from other processes/OS (aka Standard In) Pin
AJB...23-Sep-03 7:20
AJB...23-Sep-03 7:20 
GeneralRe: Receiving Input from other processes/OS (aka Standard In) Pin
Blake Coverett23-Sep-03 8:05
Blake Coverett23-Sep-03 8:05 
AJB... wrote:
From Heath's response and reading the documentation (which is weak on this) it seems that I would have to have my main method start a new Process for my app if its not already running because I need to redirect the standard input. Is that true? And how does the subsequent running of my app, after it finds the already running process, send that info to the process

No, Heath's response is certainly correct, but it is not the correct tool for the problem you are describing. You can not use the Process.ShellExecute or ProcessStartInfo to pass information to an already running process. (Well, not without implementing Shell DDE, which is old, icky and hard to do in C#.)

You can also not pass something as standard input to an already running process.

What you've described already knowing how to do is the correct first step. It sounds like the only part you are missing is how to send the arguments to the already running process if you discover there is one. This is a basic interprocess communication problem and there are many perfectly good solutions. Your main process should listen via .NET remoting or a socket or even just a custom windows message, for filename's to be passed to it. It's hard to recommend which of the many options here to use without knowing more about your application.

Some more advanced things to keep in mind:

~ What happens if a second file of the type you care about is opened while your main process is still handling the previous one?

~ How fast is your main process to load? Should you consider a small stub that actually gets registered to handle the file type and passes the name on to your main worker process?

~ Do you need to process streams as they download in IE, or just get passed the completely downloaded file out of the cache? If so you need to look at URL monikers.


--
-Blake (com/bcdev/blake)
GeneralRe: Receiving Input from other processes/OS (aka Standard In) Pin
Heath Stewart23-Sep-03 8:47
protectorHeath Stewart23-Sep-03 8:47 
GeneralNewbie in C# Pin
Member 59611223-Sep-03 4:42
Member 59611223-Sep-03 4:42 
GeneralRe: Newbie in C# Pin
Heath Stewart23-Sep-03 6:02
protectorHeath Stewart23-Sep-03 6:02 
GeneralRe: Newbie in C# Pin
Michael P Butler23-Sep-03 6:44
Michael P Butler23-Sep-03 6:44 
GeneralSystem.UnauthorizedAccessException Pin
ich_bins23-Sep-03 4:29
ich_bins23-Sep-03 4:29 
GeneralControl Designer & Child Controls Issue Pin
scott@otech.com23-Sep-03 4:14
scott@otech.com23-Sep-03 4:14 
GeneralRe: Control Designer & Child Controls Issue Pin
Heath Stewart23-Sep-03 5:50
protectorHeath Stewart23-Sep-03 5:50 
GeneralRe: Control Designer & Child Controls Issue Pin
scott@otech.com23-Sep-03 6:20
scott@otech.com23-Sep-03 6:20 
GeneralRe: Control Designer & Child Controls Issue Pin
Heath Stewart23-Sep-03 6:47
protectorHeath Stewart23-Sep-03 6:47 
GeneralRe: Control Designer & Child Controls Issue Pin
scott@otech.com24-Sep-03 7:51
scott@otech.com24-Sep-03 7:51 
GeneralRe: Control Designer & Child Controls Issue Pin
Heath Stewart24-Sep-03 8:50
protectorHeath Stewart24-Sep-03 8:50 
GeneralRe: Control Designer & Child Controls Issue Pin
scott@otech.com24-Sep-03 9:02
scott@otech.com24-Sep-03 9:02 
Questioncopy constructor needed? Pin
berndg23-Sep-03 2:59
berndg23-Sep-03 2:59 
AnswerRe: copy constructor needed? Pin
Heath Stewart23-Sep-03 3:12
protectorHeath Stewart23-Sep-03 3:12 
GeneralRe: copy constructor needed? Pin
Alvaro Mendez23-Sep-03 4:43
Alvaro Mendez23-Sep-03 4:43 
GeneralRe: copy constructor needed? Pin
Heath Stewart23-Sep-03 5:39
protectorHeath Stewart23-Sep-03 5:39 
GeneralRe: copy constructor needed? Pin
Alvaro Mendez23-Sep-03 10:37
Alvaro Mendez23-Sep-03 10:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.