> 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
> 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.