'Becuase Everything has two mode, admin mode and service mode. For service mode, there is Everything.exe service, I use commandline<>null to skip it in query
Dim everythingProcessCount As Integer = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("select * from win32_process where name='EVERYTHING.EXE' and commandline<>null").Count
If everythingProcessCount < 1 Then
'Start Everything.
End If
This is what I'm using. But is there other good approach to know Everything is running or not? And separate Everything service and client.
Thanks!
dim hWndEverything as long
hWndEverything = FindWindow("EVERYTHING_TASKBAR_NOTIFICATION", vbNullString)
If hWndEverything then
' Everything is running
Else
' Everything is not running
' Launch Everything.exe and wait for
' EVERYTHING_IPC_CREATED message
End If
'Becuase Everything has two mode, admin mode and service mode. For service mode, there is Everything.exe service, I use commandline<>null to skip it in query
Function CheckEverythingRunning() As Boolean
Dim everythingProcessCount As Long
everythingProcessCount = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("select * from win32_process where (name='EVERYTHING64.EXE' OR name='EVERYTHING.EXE') and commandline<>null").Count
If everythingProcessCount > 1 Then
CheckEverythingRunning2 = True
Else
'Start Everything.
End If
End Function