Discussion:
allow service to interact with desktop - vista and managed code
(too old to reply)
almir
2007-12-03 13:20:32 UTC
Permalink
Hi,



under Vista it is not possible to interact with users-desktop msdn
suggests using CreateProcessAsUser and I found a partial
implementation of this method in managed code here
http://odetocode.com/Blogs/scott/archive/2004/10/28/602.aspx however
i do not know how to obtain token of a user which is currently loged
in which means that I have a problem in this line
IntPtr hToken = WindowsIdentity.GetCurrent().Token; //here i get a
service token and I need user token so that i can start application in
its context, what is the right way to do it ?


do you know any other implementation which enables me to start
application so that it is visible by user?

thanks
almir
Michael Nemtsev [MVP]
2007-12-03 21:03:38 UTC
Permalink
Hello almir,

Why do u need to allow service interact with desktop?
And what does "application so that it is visible by user" mean?

As I understand u need to provide the general service without UI, but use
any IPC (interprocess communication) to talk to you separate UI application

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


a> Hi,
a>
a> under Vista it is not possible to interact with users-desktop msdn
a> suggests using CreateProcessAsUser and I found a partial
a> implementation of this method in managed code here
a> http://odetocode.com/Blogs/scott/archive/2004/10/28/602.aspx however
a> i do not know how to obtain token of a user which is currently loged
a> in which means that I have a problem in this line
a> IntPtr hToken = WindowsIdentity.GetCurrent().Token; //here i get a
a> service token and I need user token so that i can start application
a> in
a> its context, what is the right way to do it ?
a> do you know any other implementation which enables me to start
a> application so that it is visible by user?
a>
a> thanks
a> almir
almir
2007-12-04 15:04:05 UTC
Permalink
yes,
the problem is however starting application in user context, so that
he can see it
Post by Michael Nemtsev [MVP]
Hello almir,
Why do u need toallowserviceinteractwithdesktop?
And what does "application so that it is visible by user" mean?
As I understand u need to provide the generalservicewithout UI, but use
any IPC (interprocess communication) to talk to you separate UI application
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog:http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
a> Hi,
a>
a> underVistait is not possible tointeractwith users-desktopmsdn
a> suggests using CreateProcessAsUser and I found a partial
a> implementation of this method inmanagedcodehere
a>http://odetocode.com/Blogs/scott/archive/2004/10/28/602.aspxhowever
a> i do not know how to obtain token of a user which is currently loged
a> in which means that I have a problem in this line
a> IntPtr hToken = WindowsIdentity.GetCurrent().Token; //here i get a
a>servicetoken and I need user token so that i can start application
a> in
a> its context, what is the right way to do it ?
a> do you know any other implementation which enables me to start
a> application so that it is visible by user?
a>
a> thanks
a> almir
Mezga Geza
2010-12-21 12:00:26 UTC
Permalink
This method works also in Vista:
http://it.expertmonster.com/question/Allow-service-to-interact-with-desktop-112.html
Post by almir
Hi,
under Vista it is not possible to interact with users-desktop msdn
suggests using CreateProcessAsUser and I found a partial
implementation of this method in managed code here
http://odetocode.com/Blogs/scott/archive/2004/10/28/602.aspx however
i do not know how to obtain token of a user which is currently loged
in which means that I have a problem in this line
IntPtr hToken = WindowsIdentity.GetCurrent().Token; //here i get a
service token and I need user token so that i can start application in
its context, what is the right way to do it ?
do you know any other implementation which enables me to start
application so that it is visible by user?
thanks
almir
Post by Michael Nemtsev [MVP]
Hello almir,
Why do u need to allow service interact with desktop?
And what does "application so that it is visible by user" mean?
As I understand u need to provide the general service without UI, but use
any IPC (interprocess communication) to talk to you separate UI application
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
a> Hi,
a>
a> under Vista it is not possible to interact with users-desktop msdn
a> suggests using CreateProcessAsUser and I found a partial
a> implementation of this method in managed code here
a> http://odetocode.com/Blogs/scott/archive/2004/10/28/602.aspx however
a> i do not know how to obtain token of a user which is currently loged
a> in which means that I have a problem in this line
a> IntPtr hToken = WindowsIdentity.GetCurrent().Token; //here i get a
a> service token and I need user token so that i can start application
a> in
a> its context, what is the right way to do it ?
a> do you know any other implementation which enables me to start
a> application so that it is visible by user?
a>
a> thanks
a> almir
Post by almir
yes,
the problem is however starting application in user context, so that
he can see it
Submitted via EggHeadCafe
Oracle Developer For Beginners
http://www.eggheadcafe.com/training-topic-area/Oracle-SQL-Developer/2/Oracle-SQL-Samples.aspx
Loading...