Ask Everything to show search window
Ask Everything to show search window
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
Thanks.
- Vince
Re: Ask Everything to show search window
Send the tray window a command via SendMessage:
New Window:
Show an existing window, or create a new window if there is no existing window:
Toggle the search window:
Other commands:
Code: Select all
SendMessage(FindWindow("EVERYTHING_TASKBAR_NOTIFICATION",0),WM_COMMAND,MAKEWPARAM(command,0),0);
Code: Select all
SendMessage(FindWindow("EVERYTHING_TASKBAR_NOTIFICATION",0),WM_COMMAND,MAKEWPARAM(40001,0),0);
Code: Select all
SendMessage(FindWindow("EVERYTHING_TASKBAR_NOTIFICATION",0),WM_COMMAND,MAKEWPARAM(40007,0),0);
Code: Select all
SendMessage(FindWindow("EVERYTHING_TASKBAR_NOTIFICATION",0),WM_COMMAND,MAKEWPARAM(40008,0),0);
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
Re: Ask Everything to show search window
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.
Re: Ask Everything to show search window
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.
UI IDs for SendMessage and WM_COMMAND.
I'll update the SDK for the next release.
Re: Ask Everything to show search window
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
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
Re: Ask Everything to show search window
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.
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.
Re: Ask Everything to show search window
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
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
Re: Ask Everything to show search window
Yes, the service must be running to index NTFS volumes when running the client as a standard user.
Re: Ask Everything to show search window
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
Thanks, void
Re: Ask Everything to show search window
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.
This elevated app would need to call ChangeWindowMessageFilterEx to allow it to receive WM_COMMAND messages from your unelevated app.
Re: Ask Everything to show search window
I'm just experimenting. It's extra apps (like the service) that I'd like to avoid.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.