Page 1 of 1

multi-instance for search by sdk

Posted: Fri Aug 09, 2019 2:40 am
by qianw
I startup a named instance,and how to use sdk to search by specified instance?

Re: multi-instance for search by sdk

Posted: Fri Aug 09, 2019 2:51 am
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.

Re: multi-instance for search by sdk

Posted: Fri Aug 09, 2019 6:28 am
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

Re: multi-instance for search by sdk

Posted: Fri Aug 09, 2019 7:29 am
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;
}

Re: multi-instance for search by sdk

Posted: Fri Aug 09, 2019 8:19 am
by void
everything_hwnd = FindWindow("EVERYTHING_TASKBAR_NOTIFICATION_(instance name)",0);
Correct, does this work for you?

Re: multi-instance for search by sdk

Posted: Wed Aug 14, 2019 5:26 am
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.