Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

Code to determine if the VB6 App is running under a Terminal Server Session

$
0
0
Code to determine if the VB6 App isrunning under a Terminal Server Session

Code:

Private Const SM_REMOTESESSION = &H1000
Private Const SM_REMOTECONTROL = &H2001
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Public Function Is_TerminalServer() As Boolean
  ' #VBIDEUtils#************************************************************
  ' * Author          :
  ' * Web Site        :
  ' * E-Mail          :
  ' * Date            : 08/19/2011
  ' * Time            : 12:58
  ' * Module Name      : Lib_Module
  ' * Module Filename  : Lib.bas
  ' * Procedure Name  : Is_TerminalServer
  ' * Purpose          :
  ' * Parameters      :
  ' * Purpose          :
  ' **********************************************************************
  ' * Comments        :
  ' *
  ' *
  ' * Example          :
  ' *
  ' * See Also        :
  ' *
  ' * History          :
  ' *
  ' *
  ' **********************************************************************

  ' #VBIDEUtilsERROR#
  On Error GoTo ERROR_Is_TerminalServer

  If GetSystemMetrics(SM_REMOTESESSION) > 0 Then
      Is_TerminalServer = True
  Else
      Is_TerminalServer = False
  End If

EXIT_Is_TerminalServer:
  On Error Resume Next

  Exit Function

  ' #VBIDEUtilsERROR#
ERROR_Is_TerminalServer:
  Resume EXIT_Is_TerminalServer

End Function


Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>