|
-
May 4th, 2012, 01:14 AM
#1
Access a running process
Hello,
I am running an application P1 through which i am calling process P2 like
Process.start(P2)
I want to access some public variable of P1 from P2
there are 2 hurdles here:
firstly, i have to suspend P1 until P2 completes
secondly, i should make sure that P2 does not create a new instance of P1.
Any expert in c# can guide me through this?
-
May 4th, 2012, 02:33 AM
#2
Re: Access a running process
Well, multithreading is not the same as multiprocessing.
You cannot directly access "some public variable" of one process from another process. You have to implement some type of IPC (Interprocess Communications) between them.
I'm not a expert in C#, so may be wrong, but look at these .NET functions.
Victor Nijegorodov
-
May 7th, 2012, 04:51 AM
#3
Re: Access a running process
Does the process P2 "belong" to you?
Do you have access to its source code?
If yes, then it's easy to implement some kind of IPC.
If not, then you could still get access to P2's memory address space using WinAPI, this is what typical game hacks do.
________________________________
Visit my project: Derivative Calculator
-
May 14th, 2012, 01:39 AM
#4
Re: Access a running process
I want to access some public variable of P1 from P2
Please define "public." What publishing mechanism is implied here?
firstly, i have to suspend P1 until P2 completes
Suspending process isn't anything trivial, and there's no standard mechanism for this I'm aware of.
I want to access some public variable of P1 from P2
. . .
secondly, i should make sure that P2 does not create a new instance of P1.
I believe that's something wrong with the explanation. From "I want to access" I get that P2 is all yours. So to make sure P2 does not create something you should not create that something.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|