Home All Groups Group Topic Archive Search About

Using GetSystemMetrics(SM_REMOTESESSION) in VB.Net

Author
4 Mar 2006 10:43 AM
Hitesh
Hi,
   Can you please let me know the code in VB.Net for how to use 
GetSystemMetrics(SM_REMOTESESSION) to know if the application is running on
Terminal Server or on local machine.

Thanks

Author
4 Mar 2006 11:24 AM
Herfried K. Wagner [MVP]
"Hitesh" <Hit***@discussions.microsoft.com> schrieb:
> Can you please let me know the code in VB.Net for how to use
> GetSystemMetrics(SM_REMOTESESSION) to know if the application is running
> on
> Terminal Server or on local machine.

\\\
Private Declare Function GetSystemMetrics Lib "user32.dll" ( _
    ByVal nIndex As Int32 _
) As Int32

Private Const SM_REMOTESESSION As Int32 = &H1000
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
4 Mar 2006 12:01 PM
Ken Tucker [MVP]
Hi,

            Take a look at Systeminformation.terminalserversession

http://msdn2.microsoft.com/en-us/library/system.windows.forms.systeminformation.terminalserversession.aspx

Ken
--------------------------
Show quoteHide quote
"Hitesh" <Hit***@discussions.microsoft.com> wrote in message
news:DF9DEA9F-F1EE-4CB6-877E-F41F41D672B6@microsoft.com...
> Hi,
>   Can you please let me know the code in VB.Net for how to use
> GetSystemMetrics(SM_REMOTESESSION) to know if the application is running
> on
> Terminal Server or on local machine.
>
> Thanks
>