Home All Groups Group Topic Archive Search About

New Process in WinXP

Author
24 Feb 2006 3:42 PM
Ahmed Perlom
Hi all,

I want to create a window system service that sits on the background and
just fire another service/executable (i.e, notepad) every time a new user
fast switches to a new session.  How can I start a new process in another
user sessions in WinXP using .NET 1.1 or 2.0?  also how can detect the event
of user fast switch to a new session?

thanks in advance...

Author
27 Feb 2006 11:42 AM
Dmytro Lapshyn [MVP]
Hi Ahmed,

As for user logon/logoff events, you can use System Event Notification
Manager (see MSDN docs on the ISensLogon and ISensLogon2 interfaces). As for
running a process as a user, you can probably use the CreateProcessAsUser
API, but I am not sure how do you obtain the logged on user's token.

Show quote
"Ahmed Perlom" <per***@hotmail.com> wrote in message
news:%23lsS%23jVOGHA.1124@TK2MSFTNGP10.phx.gbl...
> Hi all,
>
> I want to create a window system service that sits on the background and
> just fire another service/executable (i.e, notepad) every time a new user
> fast switches to a new session.  How can I start a new process in another
> user sessions in WinXP using .NET 1.1 or 2.0?  also how can detect the
> event of user fast switch to a new session?
>
> thanks in advance...
>
Author
28 Feb 2006 10:06 PM
Ahmed Perlom
Thanks Dmytro.

The user identity might not be important to me. I wonder if there is nay
security constraints that a local system service could start another
executable whenever another user logins or fast switch to a session? Do you
think ignoring the user identity would make it any easier to implement?



Show quote
"Dmytro Lapshyn [MVP]" <x-code@no-spam-please.hotpop.com> wrote in message
news:uz8qyL5OGHA.2036@TK2MSFTNGP14.phx.gbl...
> Hi Ahmed,
>
> As for user logon/logoff events, you can use System Event Notification
> Manager (see MSDN docs on the ISensLogon and ISensLogon2 interfaces). As
> for running a process as a user, you can probably use the
> CreateProcessAsUser API, but I am not sure how do you obtain the logged on
> user's token.
>
> "Ahmed Perlom" <per***@hotmail.com> wrote in message
> news:%23lsS%23jVOGHA.1124@TK2MSFTNGP10.phx.gbl...
>> Hi all,
>>
>> I want to create a window system service that sits on the background and
>> just fire another service/executable (i.e, notepad) every time a new user
>> fast switches to a new session.  How can I start a new process in another
>> user sessions in WinXP using .NET 1.1 or 2.0?  also how can detect the
>> event of user fast switch to a new session?
>>
>> thanks in advance...
>>
>
Author
1 Mar 2006 8:24 AM
Dmytro Lapshyn [MVP]
Ahmed,

"Local system" can be an account with quite restricted rights (for example,
AFAIR it cannot access the network). So you may wish to consider running
your service at least under the "NETWORK SERVICE" account or even a more
privileged account.

Show quote
"Ahmed Perlom" <per***@hotmail.com> wrote in message
news:%23xGcBNLPGHA.516@TK2MSFTNGP15.phx.gbl...
> Thanks Dmytro.
>
> The user identity might not be important to me. I wonder if there is nay
> security constraints that a local system service could start another
> executable whenever another user logins or fast switch to a session? Do
> you think ignoring the user identity would make it any easier to
> implement?
>
>
>
> "Dmytro Lapshyn [MVP]" <x-code@no-spam-please.hotpop.com> wrote in message
> news:uz8qyL5OGHA.2036@TK2MSFTNGP14.phx.gbl...
>> Hi Ahmed,
>>
>> As for user logon/logoff events, you can use System Event Notification
>> Manager (see MSDN docs on the ISensLogon and ISensLogon2 interfaces). As
>> for running a process as a user, you can probably use the
>> CreateProcessAsUser API, but I am not sure how do you obtain the logged
>> on user's token.
>>
>> "Ahmed Perlom" <per***@hotmail.com> wrote in message
>> news:%23lsS%23jVOGHA.1124@TK2MSFTNGP10.phx.gbl...
>>> Hi all,
>>>
>>> I want to create a window system service that sits on the background and
>>> just fire another service/executable (i.e, notepad) every time a new
>>> user fast switches to a new session.  How can I start a new process in
>>> another user sessions in WinXP using .NET 1.1 or 2.0?  also how can
>>> detect the event of user fast switch to a new session?
>>>
>>> thanks in advance...
>>>
>>
>
>

AddThis Social Bookmark Button