Page 1 of 1

How to know Everything is running or not?

Posted: Wed Jan 20, 2021 10:40 pm
by kaifuzi

Code: Select all

'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!

Re: How to know Everything is running or not?

Posted: Wed Jan 20, 2021 10:51 pm
by void
To determine if the Everything client is running or not:

Code: Select all

    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
https://www.voidtools.com/support/everything/sdk/ipc_c_example/

Re: How to know Everything is running or not?

Posted: Wed Jan 20, 2021 11:23 pm
by kaifuzi
Thanks!I will test this approach and back to here.

Re: How to know Everything is running or not?

Posted: Thu Jan 21, 2021 8:53 pm
by kaifuzi
After try your code, it works well, thanks!

Re: How to know Everything is running or not?

Posted: Sat Jun 10, 2023 1:29 am
by AutoSoft
'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