Setting Active Process

Q

Qu

Hi everyone.

The short version: I need a way to change the currently active process
at run-time.

The long version: I need to get a directory path out of an external
application. The only way I seem to be able to find this path is with
an environment variable: "XS_PROJECT". Therefore, I can get it via
"Environment.GetEnvironmentVariable("XS_PROJECT");.

But before I do this, I need to change the currently active process
from my form (ProjectStatus.exe) to an open version of the application
(TeklaStructures.exe).

So if anyone could help me with this one, I'd be grateful.
Alternatively, if there's a way to get the Environment Variable
without taking focus from the form, that'd be even better!

Thanks,
Qu.
 
F

Family Tree Mike

It sounds like you are describing your own code within another process. I
don't know of a way to do this. If you are able to get the directory from an
environment variable, then why do you need to get into the other process?
 
Q

Qu

It sounds like you are describing your own code within another process.  I
don't know of a way to do this.  If you are able to get the directory from an
environment variable, then why do you need to get into the other process?










- Show quoted text -

I don't need to get into the other process. All I need is that one
environment variable (which happends to be a directory path, which can
vary depending on how the user opened the external application).
That's all I need.

The only way I know how to retrive Environment Variables, however, is
via Environment.GetEnvironmentVariable()... which only works if the
program containing the variable has focus.

Sorry I didn't explain it well enough first time around.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top