How to get the index completion message as soon as Everything is opened in programming mode?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
Autumn
Posts: 3
Joined: Wed Aug 28, 2024 8:48 am

How to get the index completion message as soon as Everything is opened in programming mode?

Post by Autumn »

I am writing a software to utilize Everything to search for files. I package Everything.exe and Everything64.dll together with the software. When the software runs, it will open the Everything.exe program. However, I cannot obtain correct search information using the API before the index is built. I have not found any API that can retrieve the index building process. My current approach is to open Everything.exe, wait for 1 second, and then call the Everything_GetResultPath method. This method seems to block until the indexing is finished. Is there a better way to do this?
void
Developer
Posts: 16770
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to get the index completion message as soon as Everything is opened in programming mode?

Post by void »

Please poll the following until it returns true:

Everything_IsDBLoaded()
Autumn
Posts: 3
Joined: Wed Aug 28, 2024 8:48 am

Re: How to get the index completion message as soon as Everything is opened in programming mode?

Post by Autumn »

void wrote: Wed Aug 28, 2024 9:37 am Please poll the following until it returns true:

Everything_IsDBLoaded()
Is there any process message for listening? So maybe I can listen in Via OnMessage
void
Developer
Posts: 16770
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to get the index completion message as soon as Everything is opened in programming mode?

Post by void »

There's no broadcast message for when the database is loaded.
void
Developer
Posts: 16770
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to get the index completion message as soon as Everything is opened in programming mode?

Post by void »

I went to add this feature and found I had already done it in 1348a..

Everything will post an "EVERYTHING_DB_LOADED" message to all top level windows when the database has been loaded.

RegisterWindowMessageW
Autumn
Posts: 3
Joined: Wed Aug 28, 2024 8:48 am

Re: How to get the index completion message as soon as Everything is opened in programming mode?

Post by Autumn »

Can you provide sample code for the EVERYTHING_DB_LOADED message?
If I call the API to create an index and save the data to a database file, will the index in the database be automatically updated the next time I search by loading the previously generated database file? I'm concerned that file changes made between the first indexing and the user's second launch of my software might not be captured by the software.
void
Developer
Posts: 16770
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to get the index completion message as soon as Everything is opened in programming mode?

Post by void »

Code: Select all

UINT everything_db_loaded_message = RegisterWindowMessageW(L"EVERYTHING_DB_LOADED");

...

LRESULT WINAPI my_top_level_window_proc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
	switch(msg)
	{
		...
	}
		
	if (everything_db_loaded_message)
	{
		if (msg == everything_db_loaded_message)
		{
			// the Everything database is now loaded.
			my_on_everything_db_loaded();
		}
	}
	
	return DefWindowProc(hwnd,msg,wParam,lParam);
}

If I call the API to create an index and save the data to a database file, will the index in the database be automatically updated the next time I search by loading the previously generated database file? I'm concerned that file changes made between the first indexing and the user's second launch of my software might not be captured by the software.
Everything manages the database in memory.
The Everything IPC communicates with Everything and this database in memory.
Everything will save the database to disk when you exit Everything.
Everything will reload the database from disk when you restart Everything.
The Everything IPC will always gather the most recent and up-to-date information.
Post Reply