Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2007

Tip: Looking for answers? Try searching our database.

Application inside remote desktop?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ARTMIC - 22 Nov 2007 15:07 GMT
Did anyone ever need to know if your application is being run inside a remote
desktop session?
I have an application written in .Net 2.0
And I need to know if that application was started inside of a remote
desktop session.
Are there any win API calls I can call to find out if this is the case?
Johannes Passing - 22 Nov 2007 15:28 GMT
> Did anyone ever need to know if your application is being run inside a remote
> desktop session?
> I have an application written in .Net 2.0
> And I need to know if that application was started inside of a remote
> desktop session.
> Are there any win API calls I can call to find out if this is the case?

Use GetSystemMetrics(SM_REMOTESESSION).

--Johannes

Signature

Johannes Passing - http://int3.de/

ARTMIC - 22 Nov 2007 15:34 GMT
thank you,
i will give it a try.

> > Did anyone ever need to know if your application is being run inside a remote
> > desktop session?
[quoted text clipped - 6 lines]
>
> --Johannes
ARTMIC - 22 Nov 2007 16:00 GMT
Ok thanks, that worked like a charm.

Now how do i know the info about the person that logs in through the remote
session? Like their user name, IP address, etc...?

> > Did anyone ever need to know if your application is being run inside a remote
> > desktop session?
[quoted text clipped - 6 lines]
>
> --Johannes
Johannes Passing - 22 Nov 2007 16:28 GMT
Refer to the Windows Terminal Services API documentation on MSDN:
  http://msdn2.microsoft.com/en-us/library/aa383468.aspx
You probably want to use WTSQuerySessionInformation.

--Johannes

> Ok thanks, that worked like a charm.
>
[quoted text clipped - 11 lines]
>>
>> --Johannes

Signature

Johannes Passing - http://int3.de/

ARTMIC - 22 Nov 2007 20:39 GMT
Thanks for the help i will try that next.

> Refer to the Windows Terminal Services API documentation on MSDN:
>    http://msdn2.microsoft.com/en-us/library/aa383468.aspx
[quoted text clipped - 17 lines]
> >>
> >> --Johannes
Willy Denoyette [MVP] - 22 Nov 2007 19:32 GMT
> Did anyone ever need to know if your application is being run inside a
> remote
[quoted text clipped - 3 lines]
> desktop session.
> Are there any win API calls I can call to find out if this is the case?

Check the System.Windows.Forms.TerminalServerSession Property, no need to
interop with unmanaged stuff.

Willy.
Mattias Sjögren - 22 Nov 2007 20:10 GMT
>Check the System.Windows.Forms.TerminalServerSession Property, no need to
                              /\
                        SystemInformation.

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

ARTMIC - 22 Nov 2007 20:39 GMT
Thanks, that did the trick also :)

> >Check the System.Windows.Forms.TerminalServerSession Property, no need to
>                                /\
>                          SystemInformation.
>
> Mattias
Willy Denoyette [MVP] - 23 Nov 2007 00:23 GMT
> >Check the System.Windows.Forms.TerminalServerSession Property, no need to
>                               /\
>                         SystemInformation.

Oops, I knew I was missing something ;-)

Willy.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.