How to know Everything is running or not?

Plug-in and third party software discussion.
Post Reply
kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

How to know Everything is running or not?

Post 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!
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to know Everything is running or not?

Post 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/
kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: How to know Everything is running or not?

Post by kaifuzi »

Thanks!I will test this approach and back to here.
kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: How to know Everything is running or not?

Post by kaifuzi »

After try your code, it works well, thanks!
AutoSoft
Posts: 30
Joined: Fri Jun 09, 2023 9:56 am

Re: How to know Everything is running or not?

Post 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
Post Reply