multi-instance for search by sdk

Plug-in and third party software discussion.
Post Reply
qianw
Posts: 20
Joined: Fri Aug 09, 2019 2:29 am

multi-instance for search by sdk

Post by qianw »

I startup a named instance,and how to use sdk to search by specified instance?
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: multi-instance for search by sdk

Post by void »

The SDK does not support named instances, yet.

For now, you will need to re-build the SDK with your custom instance name.

You'll need to change the following line (there are 5 of them - change all of them):

Code: Select all

everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0);
to:

everything_hwnd = FindWindow("EVERYTHING_(instance name)",0);

Code: Select all

everything_hwnd = FindWindow("EVERYTHING_TASKBAR_NOTIFICATION_(instance name)",0);
where instance name is your custom instance name.

Check the ES source code.
ES uses the Everything IPC (which is what the Everything SDK is built on) and supports named instances with the -instance command line option.
qianw
Posts: 20
Joined: Fri Aug 09, 2019 2:29 am

Re: multi-instance for search by sdk

Post by qianw »

My instance name is "abc",I try to change macro "EVERYTHING_IPC_WNDCLASS" like
#define EVERYTHING_IPC_WNDCLASSW L"EVERYTHING_(abc)"//L"EVERYTHING_TASKBAR_NOTIFICATION"
#define EVERYTHING_IPC_WNDCLASSA EVERYTHING_(abc)"//"EVERYTHING_TASKBAR_NOTIFICATION"
but search failed
qianw
Posts: 20
Joined: Fri Aug 09, 2019 2:29 am

Re: multi-instance for search by sdk

Post by qianw »

void wrote: Fri Aug 09, 2019 2:51 am The SDK does not support named instances, yet.

For now, you will need to re-build the SDK with your custom instance name.

You'll need to change the following line (there are 5 of them - change all of them):

Code: Select all

everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0);
to:

Code: Select all

everything_hwnd = FindWindow("EVERYTHING_(instance name)",0);
where instance name is your custom instance name.

Check the ES source code.
ES uses the Everything IPC (which is what the Everything SDK is built on) and supports named instances with the -instance command line option.
I changed the following line :

Code: Select all

everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0);
to:

Code: Select all

everything_hwnd = FindWindow("EVERYTHING_TASKBAR_NOTIFICATION_(instance name)",0);
not to:

Code: Select all

everything_hwnd = FindWindow("EVERYTHING_(instance name)",0);
that's right?
I noticed ES did the same.

Code: Select all

HWND es_find_ipc_window(void)
{
	wchar_t window_class[ES_BUF_SIZE];
	HWND hwnd;
	*window_class = 0;
	es_wstring_cat(window_class,EVERYTHING_IPC_WNDCLASS);
	if (*es_instance)
	{
		es_wstring_cat(window_class,L"_(");
		es_wstring_cat(window_class,es_instance);
		es_wstring_cat(window_class,L")");
	}
	hwnd = FindWindow(window_class,0);
	return hwnd;
}
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: multi-instance for search by sdk

Post by void »

everything_hwnd = FindWindow("EVERYTHING_TASKBAR_NOTIFICATION_(instance name)",0);
Correct, does this work for you?
qianw
Posts: 20
Joined: Fri Aug 09, 2019 2:29 am

Re: multi-instance for search by sdk

Post by qianw »

void wrote: Fri Aug 09, 2019 8:19 am
everything_hwnd = FindWindow("EVERYTHING_TASKBAR_NOTIFICATION_(instance name)",0);
Correct, does this work for you?
Yes,the problem was solved.
Post Reply