By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,306 Members | 1,621 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,306 IT Pros & Developers. It's quick & easy.

Setting Active Process

P: n/a
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.
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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?

"Qu" wrote:
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.
Jun 27 '08 #2

P: n/a
Qu
On Apr 28, 12:47*pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
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?

"Qu" wrote:
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.- Hide quoted text -

- 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.
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.