News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Name:Alex Dybenko

Location:Moscow, Russia

Thursday, March 24, 2011

Is your Application Running under Terminal Services?

Below VBA code to check this, IsRunningInTerminal() function returns True when you Access application runs in Terminal server session:

Private Declare Function GetSystemMetrics _
Lib "user32" (ByVal nIndex As Long) As Long

Public Const SM_REMOTESESSION As Long = &H1000

Function IsRunningInTerminal() As Boolean
   IsRunningInTerminal = _
      (GetSystemMetrics(SM_REMOTESESSION) <> 0)
End Function

Labels: , ,


Post a Comment

<< Home