Public Class OS Public cMessage As String = "" Public cServer As String = "" Public lRunning As Boolean = False Public nProcessID As Integer = 0 Private cYouNeedToDefineTheProcessID As String = "" Private nLanguage As Integer = 1 Private oApp As App = Nothing Private oProcess As LXProcess = Nothing ' This is when we access the data provider in desktop and Web service mode Sub New(ByVal toApplication As App) oApp = toApplication nLanguage = oApp.nLanguage Init() End Sub ' This is when we access the data provider in a Web mode Public Sub New(ByVal toProcess As LXProcess) oProcess = toProcess oApp = oProcess.oApp nLanguage = oProcess.nLanguage Init() End Sub ' Initialization Private Function Init() As Boolean ' Based on the language Select Case nLanguage ' English Case 1 cYouNeedToDefineTheProcessID = "You need to define the nProcessID property." ' French Case 2 cYouNeedToDefineTheProcessID = "Vous devez définir la propriété nProcessID." ' Spanish Case 3 cYouNeedToDefineTheProcessID = "You need to define the nProcessID property." ' Portuguese Case 4 cYouNeedToDefineTheProcessID = "You need to define the nProcessID property." End Select Return True End Function ' See if a process ID is running Public Function IsProcessRunning() As Boolean Dim lcServer As String = "" Dim llSuccess As Boolean = False Dim loProcess As Process = Nothing ' Reset everything cMessage = "" lRunning = False ' Initialization lcServer = Trim(cServer) ' If we have not defined the process ID If nProcessID = 0 Then cMessage = cYouNeedToDefineTheProcessID Return False End If ' Try to get an object Try ' If we have a server If lcServer.Length > 0 Then loProcess = Process.GetProcessById(nProcessID, lcServer) Else loProcess = Process.GetProcessById(nProcessID) End If llSuccess = True Catch loError As Exception cMessage = loError.Message Return False End Try ' If the process is running If Not IsNothing(loProcess) Then lRunning = True End If ' Reset everything cServer = "" nProcessID = 0 Return llSuccess End Function End Class