Process Main Windows

11 views
Skip to first unread message

srikanth

unread,
Dec 4, 2009, 1:45:33 AM12/4/09
to Cassia Users
Hi Guys,

How To exract main window titles in all sessions,when i
get underlying process from ITerminalServiceProcess,its only listing
the current session's, main window titles,and all other sesions
mainwindow titles are blank.

Can SomeOne help on this?


Regards,
Srikanth.

Dan Ports

unread,
Dec 4, 2009, 8:45:25 AM12/4/09
to cassia...@googlegroups.com
Srikanth,

This is a limitation of the System.Diagnostics.Process class. Internally, it uses the EnumWindows API call to find the main window associated with a process. However, EnumWindows only lists the windows in the current terminal session. For more information, see this question this user posted:

If I find any more information, I'll let you know.

Dan


--

You received this message because you are subscribed to the Google Groups "Cassia Users" group.
To post to this group, send email to cassia...@googlegroups.com.
To unsubscribe from this group, send email to cassia-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cassia-users?hl=en.



srikanth

unread,
Dec 6, 2009, 11:39:21 PM12/6/09
to Cassia Users
Dan,
Thanks for your response.
Can you tell me how to start a program in a specific session
from other session?

Regards,
Srikanth.

On Dec 4, 6:45 pm, Dan Ports <danpo...@gmail.com> wrote:
> Srikanth,
>
> This is a limitation of the System.Diagnostics.Process class. Internally, it
> uses the EnumWindows API call to find the main window associated with a
> process. However, EnumWindows only lists the windows in the current terminal
> session. For more information, see this question this user posted:http://stackoverflow.com/questions/308135/how-can-i-enumerate-the-ope...
>
> If I find any more information, I'll let you know.
>
> <http://stackoverflow.com/questions/308135/how-can-i-enumerate-the-ope...>
> Dan
>
> On Fri, Dec 4, 2009 at 1:45 AM, srikanth <srikanth.cs...@gmail.com> wrote:
> > Hi Guys,
>
> >             How To exract main window titles in all sessions,when i
> > get underlying process from ITerminalServiceProcess,its only listing
> > the current session's, main window titles,and all other sesions
> > mainwindow titles are blank.
>
> > Can SomeOne help on this?
>
> > Regards,
> > Srikanth.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Cassia Users" group.
> > To post to this group, send email to cassia...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cassia-users...@googlegroups.com<cassia-users%2Bunsu...@googlegroups.com>
> > .

srikanth gundala

unread,
Dec 6, 2009, 9:49:51 PM12/6/09
to cassia...@googlegroups.com
Dan,

         Thanks for your help.I will try this.

Regards,
Srikanth.

Dan Ports

unread,
Dec 7, 2009, 5:44:34 PM12/7/09
to cassia...@googlegroups.com
Srikanth,

Check out this blog post on that topic:

Dan

To unsubscribe from this group, send email to cassia-users...@googlegroups.com.

srikanth

unread,
Dec 9, 2009, 1:07:16 AM12/9/09
to Cassia Users
Hi Dan,

Thanks a lot for ur response, I tried those things,
Will WTSQueryUserToken() work for remote desktop session?
If it doesn't Can u specify what to use?

Regards,
Srikanth.

On Dec 8, 3:44 am, Dan Ports <danpo...@gmail.com> wrote:
> Srikanth,
>
> Check out this blog post on that topic:http://www.remkoweijnen.nl/blog/2007/10/20/how-to-launch-a-process-in...
>
> <http://www.remkoweijnen.nl/blog/2007/10/20/how-to-launch-a-process-in...>
> Dan
> > <cassia-users%2Bunsu...@googlegroups.com<cassia-users%252Buns...@googlegroups.com>

Dan Ports

unread,
Dec 9, 2009, 8:04:36 AM12/9/09
to cassia...@googlegroups.com
Srikanth,

Yes, WTSQueryUserToken will give you the primary access token of the user associated with a particular remote desktop session, and using that token you can launch a process in that session (with CreateProcessAsUser).

Dan

To unsubscribe from this group, send email to cassia-users...@googlegroups.com.

srikanth gundala

unread,
Dec 11, 2009, 7:02:05 AM12/11/09
to cassia...@googlegroups.com
Dan,
     Thank u very much,finally i got that and i was able to start the process in remote desktop session.

Thanks,
Srikanth.
Reply all
Reply to author
Forward
0 new messages