Ask Everything to show search window

Plug-in and third party software discussion.
Post Reply
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Ask Everything to show search window

Post by vfatica »

How can I programmatically ask a running Everything to show its search window (or create a new one) as can be done via the tray interface?
Thanks.

- Vince
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ask Everything to show search window

Post by void »

Send the tray window a command via SendMessage:

Code: Select all

SendMessage(FindWindow("EVERYTHING_TASKBAR_NOTIFICATION",0),WM_COMMAND,MAKEWPARAM(command,0),0);
New Window:

Code: Select all

SendMessage(FindWindow("EVERYTHING_TASKBAR_NOTIFICATION",0),WM_COMMAND,MAKEWPARAM(40001,0),0);
Show an existing window, or create a new window if there is no existing window:

Code: Select all

SendMessage(FindWindow("EVERYTHING_TASKBAR_NOTIFICATION",0),WM_COMMAND,MAKEWPARAM(40007,0),0);
Toggle the search window:

Code: Select all

SendMessage(FindWindow("EVERYTHING_TASKBAR_NOTIFICATION",0),WM_COMMAND,MAKEWPARAM(40008,0),0);
Other commands:

Code: Select all

#define UI_ID_TRAY_NEW_SEARCH_WINDOW 40001
#define UI_ID_TRAY_CONNECT_TO_ETP_SERVER 40004
#define UI_ID_TRAY_OPTIONS 40005
#define UI_ID_TRAY_EXIT 40006
#define UI_ID_TRAY_SHOW_SEARCH_WINDOW 40007
#define UI_ID_TRAY_TOGGLE_SEARCH_WINDOW 40008
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Ask Everything to show search window

Post by vfatica »

Thanks! Are those defines/examples in any of the source dowloads? I didn't see them. I was also going to ask about getting to "Options" that way.
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ask Everything to show search window

Post by void »

For a list of all the commands, please see:
UI IDs for SendMessage and WM_COMMAND.

I'll update the SDK for the next release.
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Ask Everything to show search window

Post by vfatica »

Thanks again. Hmmm! It's not working and I don't completely understand why.

The instance of Everything.exe in question was started by a logon-triggered scheduled task as me and with the highest privileges. This way of starting it avoids the UAC prompt.

I can find the window, but SendMessage() isn't working. GetLastEror() is ERROR_ACCESS_DENIED, possibly a sign that SendMessage() is blocked by UIPI (User Interface Privilege Isolation). That said, both ES.EXE and one of the SDK samples (built by me), run un-elevated, can both communicate with this instance of Everything.exe (and that's with SendMessage(WM_COPYDATA) ... right?).

I must be missing something. Help would be appreciated.

- Vince
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ask Everything to show search window

Post by void »

Your app must have the same privileges as Everything to send any commands.
However, Everything will allow the IPCs WM_COPYDATA from any app with any privileges.

Everything calls ChangeWindowMessageFilterEx to allow WM_COPYDATA and WM_USER from any app with any privileges.
Other messages sent from an app with insufficient privileges will fail with access denied.

You will need to run your app as admin, or run Everything as a standard user to send command messages.
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Ask Everything to show search window

Post by vfatica »

Drat!

And the only way to run Everything un-elevated and have it catalog NTFS drives is to also use Everything running as a service ... right?

- Vince
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ask Everything to show search window

Post by void »

Yes, the service must be running to index NTFS volumes when running the client as a standard user.
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Ask Everything to show search window

Post by vfatica »

Sigh! My approach (Everything elevated from logon-triggered scheduled task) is quite sufficient for queries (that's what's most important). I was hoping to add extra functionality. But I can live without that since I have the tray icon.

Thanks, void
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ask Everything to show search window

Post by void »

Maybe implement an app that runs elevated and relays the messages from your unelevated app to Everything?

This elevated app would need to call ChangeWindowMessageFilterEx to allow it to receive WM_COMMAND messages from your unelevated app.
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Ask Everything to show search window

Post by vfatica »

void wrote:Maybe implement an app that runs elevated and relays the messages from your unelevated app to Everything?

This elevated app would need to call ChangeWindowMessageFilterEx to allow it to receive WM_COMMAND messages from your unelevated app.
I'm just experimenting. It's extra apps (like the service) that I'd like to avoid.
Post Reply