[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Application inside remote desktop?

ARTMIC

11/22/2007 3:07:00 PM

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?

9 Answers

Johannes Passing

11/22/2007 3:29:00 PM

0

ARTMIC wrote:
> 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

--
Johannes Passing - http:...

ARTMIC

11/22/2007 3:34:00 PM

0

thank you,
i will give it a try.

"Johannes Passing" wrote:

> ARTMIC wrote:
> > 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
>
> --
> Johannes Passing - http:...
>

ARTMIC

11/22/2007 4:00:00 PM

0

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


"Johannes Passing" wrote:

> ARTMIC wrote:
> > 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
>
> --
> Johannes Passing - http:...
>

Johannes Passing

11/22/2007 4:28:00 PM

0

Refer to the Windows Terminal Services API documentation on MSDN:
http://msdn2.microsoft.com/en-us/library/aa3...
You probably want to use WTSQuerySessionInformation.

--Johannes

ARTMIC wrote:
> 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...?
>
>
> "Johannes Passing" wrote:
>
>> ARTMIC wrote:
>>> 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
>>
>> --
>> Johannes Passing - http:...
>>


--
Johannes Passing - http:...

Willy Denoyette [MVP]

11/22/2007 7:32:00 PM

0

"ARTMIC" <ARTMIC@discussions.microsoft.com> wrote in message
news:DB1A44D4-3C7B-459C-BAD9-5B9586911C6C@microsoft.com...
> 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?
>


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

Willy.

(Mattias Sjögren)

11/22/2007 8:10:00 PM

0

>Check the System.Windows.Forms.TerminalServerSession Property, no need to
/ SystemInformation.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.n... | http://www.dotneti...
Please reply only to the newsgroup.

ARTMIC

11/22/2007 8:39:00 PM

0

Thanks, that did the trick also :)


"Mattias Sjögren" wrote:

> >Check the System.Windows.Forms.TerminalServerSession Property, no need to
> /> SystemInformation.
>
>
> Mattias
>
> --
> Mattias Sjögren [C# MVP] mattias @ mvps.org
> http://www.msjogren.n... | http://www.dotneti...
> Please reply only to the newsgroup.
>

ARTMIC

11/22/2007 8:39:00 PM

0

Thanks for the help i will try that next.

"Johannes Passing" wrote:

> Refer to the Windows Terminal Services API documentation on MSDN:
> http://msdn2.microsoft.com/en-us/library/aa3...
> You probably want to use WTSQuerySessionInformation.
>
> --Johannes
>
> ARTMIC wrote:
> > 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...?
> >
> >
> > "Johannes Passing" wrote:
> >
> >> ARTMIC wrote:
> >>> 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
> >>
> >> --
> >> Johannes Passing - http:...
> >>
>
>
> --
> Johannes Passing - http:...
>

Willy Denoyette [MVP]

11/23/2007 12:24:00 AM

0

"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:uRib%23OULIHA.4196@TK2MSFTNGP04.phx.gbl...
> >Check the System.Windows.Forms.TerminalServerSession Property, no need to
> /> SystemInformation.
>
>

Oops, I knew I was missing something ;-)

Willy.