Application inside remote desktop? - DOTNET

This is a discussion on Application inside remote desktop? - DOTNET ; 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 ...

+ Reply to Thread
Results 1 to 10 of 10

Application inside remote desktop?

  1. Default Application inside remote desktop?

    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?


  2. Default Re: Application inside remote desktop?

    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://int3.de/

  3. Default Re: Application inside remote desktop?

    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://int3.de/
    >


  4. Default Re: Application inside remote desktop?

    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://int3.de/
    >


  5. Default Re: Application inside remote desktop?

    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

    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://int3.de/
    >>



    --
    Johannes Passing - http://int3.de/

  6. Default Re: Application inside remote desktop?

    "ARTMIC" <ARTMIC@discussions.microsoft.com> wrote in message
    newsB1A44D4-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.


  7. Default Re: Application inside remote desktop?

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


    Mattias

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

  8. Default Re: Application inside remote desktop?

    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.net/dotnet/ | http://www.dotnetinterop.com
    > Please reply only to the newsgroup.
    >


  9. Default Re: Application inside remote desktop?

    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/aa383468.aspx
    > 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://int3.de/
    > >>

    >
    >
    > --
    > Johannes Passing - http://int3.de/
    >


  10. Default Re: Application inside remote desktop?

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


+ Reply to Thread

Similar Threads

  1. Application inside remote Desktop?
    By Application Development in forum DOTNET
    Replies: 1
    Last Post: 11-22-2007, 03:11 PM
  2. Remote Desktop Affects Windows Application on network interruption
    By Application Development in forum DOTNET
    Replies: 15
    Last Post: 06-04-2007, 09:09 PM
  3. Replies: 4
    Last Post: 10-31-2005, 07:26 AM
  4. C# - remote application that is interactive with desktop
    By Application Development in forum DOTNET
    Replies: 3
    Last Post: 02-22-2005, 05:34 PM
  5. Replies: 0
    Last Post: 04-15-2004, 01:28 PM