Test for previous instance ? 
Author Message
 Test for previous instance ?

Migrating from VB6 to VB.Net, the wizard translated App.PreviousInstance()
by something like that :
If
(UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurren
tProcess.ProcessName)) > 0) Then

But the resulting behavior is not the same !
Using TSE (Terminal Server) and logging as different users, I can launch the
VB6 app once per user (resulting in as many instances of my application),
but I can launch only one instance of the .Net app for all users.

How can I determine who is a process owner (as in the WXP task manager) ?
or
How can I list processes owned by a given user to determine if my app
already started for him ?

Thanks
Ben



Fri, 04 Nov 2005 21:45:49 GMT  
 Test for previous instance ?
Hi Benoit,
A __very__ crude (and probably not foolproof) method would be to use the
Environment.GetEnvironmentVariable method to determine the currently logged
on user name by examining the following variables:

USERDNSDOMAIN
USERDOMAIN
USERNAME

I do not know the impact of using environment variables within TSE, I'll
check on that and let u know. Meanwhile can you check this out. I'm
researching what better we can do for this case.

Regards,

Arvind.

--
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
This posting is provided "AS IS" with no warranties, and confers no rights.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-


Quote:
> Migrating from VB6 to VB.Net, the wizard translated App.PreviousInstance()
> by something like that :
> If

(UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurren
Quote:
> tProcess.ProcessName)) > 0) Then

> But the resulting behavior is not the same !
> Using TSE (Terminal Server) and logging as different users, I can launch
the
> VB6 app once per user (resulting in as many instances of my application),
> but I can launch only one instance of the .Net app for all users.

> How can I determine who is a process owner (as in the WXP task manager) ?
> or
> How can I list processes owned by a given user to determine if my app
> already started for him ?

> Thanks
> Ben



Sat, 05 Nov 2005 15:39:17 GMT  
 Test for previous instance ?
Ok, thank you for your guidance.
I will test this method. If you find a better one, let me know !

Thanks again
Ben



Quote:
> Hi Benoit,
> A __very__ crude (and probably not foolproof) method would be to use the
> Environment.GetEnvironmentVariable method to determine the currently
logged
> on user name by examining the following variables:

> USERDNSDOMAIN
> USERDOMAIN
> USERNAME

> I do not know the impact of using environment variables within TSE, I'll
> check on that and let u know. Meanwhile can you check this out. I'm
> researching what better we can do for this case.

> Regards,

> Arvind.

> --

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Quote:
> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
> This posting is provided "AS IS" with no warranties, and confers no
rights.

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Quote:
> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-



> > Migrating from VB6 to VB.Net, the wizard translated

App.PreviousInstance()
Quote:
> > by something like that :
> > If

(UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurren

- Show quoted text -

Quote:
> > tProcess.ProcessName)) > 0) Then

> > But the resulting behavior is not the same !
> > Using TSE (Terminal Server) and logging as different users, I can launch
> the
> > VB6 app once per user (resulting in as many instances of my
application),
> > but I can launch only one instance of the .Net app for all users.

> > How can I determine who is a process owner (as in the WXP task manager)
?
> > or
> > How can I list processes owned by a given user to determine if my app
> > already started for him ?

> > Thanks
> > Ben



Sat, 05 Nov 2005 17:16:24 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HELP: Passing a command line from a second instance of an app to the previous instance

2. TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST

3. Mutexes, previous instances and DDE

4. Previous Instance

5. Running a Previous Instance

6. How to detect previous instance ?

7. Restore Previous Instance

8. Check Previous Instance, Launch If Any

9. Terminating a previous instance

10. passing arguments to a previous instance

11. Restoring Previous Instance of MDI Application

12. Shutting Down Previous Instance of Excel from VB6 Program

 

 
Powered by phpBB® Forum Software