How to give a window launched from the command line a static title

Discussion related to "Everything" 1.5 Alpha.
Post Reply
hellen_dorandt89
Posts: 52
Joined: Sun Apr 03, 2022 5:52 pm

How to give a window launched from the command line a static title

Post by hellen_dorandt89 »

Reading this specific post Title Bar specify custom text - voidtools forum I was able to figure out how to give a window launched from the command line (-Define) a specific title:

Code: Select all

Everything64 -n -define windowtitle="My New title"
It works, the new window does get the title.
but so does every other new window after that command, either via GUI File > New Window or just:

Code: Select all

Everything64 -n
I really need it only for one window, so I can track it using its unique name until its destroyed.
Is there a way that Everything64 -n -define windowtitle="My New title" will only apply to the new window?
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to give a window launched from the command line a static title

Post by therube »

Maybe ? something can be done with GUIPropView?
hellen_dorandt89
Posts: 52
Joined: Sun Apr 03, 2022 5:52 pm

Re: How to give a window launched from the command line a static title

Post by hellen_dorandt89 »

therube wrote: Thu Dec 01, 2022 6:28 pm Maybe ? something can be done with GUIPropView?
I did try something like in the programming language I am using, Autohotkey. The active everything window title bar changes but as soon as I change curretn everything search in that window the title is also reset
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to give a window launched from the command line a static title

Post by void »

I couldn't find a good solution here.

The next alpha update will have support for a window style 0x00000800 flag to lock the window text.

With Autohotkey, you'll be able to set this style and then set the window text.
Everything will not update the window title when this style is set.

For now, maybe another option is to change the icon (WM_SETICON from Autohotkey)?
Everything doesn't change the icon once set.



I am considering per window preprocessor variables.
I am considering window instance names.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to give a window launched from the command line a static title

Post by void »

Everything 1.5.0.1331a adds a 0x00000800 window style to lock the window text.
meteorquake
Posts: 505
Joined: Thu Dec 15, 2016 9:44 pm

Re: How to give a window launched from the command line a static title

Post by meteorquake »

I'm not sure if the last answer covers you fully (I suspect it may) but another option I would presume is to give the launched item a unique random starting string using nop: (e.g. nop:98723463) then scan the windows to find the window title with that opening's underlying ID, so you can continue to spot it even if the search string gets changed.
d
hellen_dorandt89
Posts: 52
Joined: Sun Apr 03, 2022 5:52 pm

Re: How to give a window launched from the command line a static title

Post by hellen_dorandt89 »

void wrote: Sun Dec 04, 2022 3:13 am I couldn't find a good solution here.

The next alpha update will have support for a window style 0x00000800 flag to lock the window text.

With Autohotkey, you'll be able to set this style and then set the window text.
Everything will not update the window title when this style is set.

For now, maybe another option is to change the icon (WM_SETICON from Autohotkey)?
Everything doesn't change the icon once set.



I am considering per window preprocessor variables.
I am considering window instance names.
Hi void, sorry I had to drop things to take care of kids.

I have installed the latest Version 1.5.0.1332a (x64) which has support for the 0x00000800 window style you mentioned.
I did some tests with Autohotkey to set its title:

Code: Select all

~Browser_Back & space::
WinSetTitle, A, , Some Identifying Title
WinSet, Style, 0x00000800
Return
it does set the title but as soon as I update the search bar in everything, everythings title is reset. This does not seem to be diffrent than what I had reported in this thread earlier.

In line 3 of my code above,
WinSet, Style, 0x00000800
is that the correct way to invoke window style 0x00000800 flag from Autohotkey?

another option is to change the icon (WM_SETICON from Autohotkey)?
Everything doesn't change the icon once set.
This sounds really intresting, I did some tests and was able to change a specific Everythings window icon with:

Code: Select all

WM_SETICON := 0x80
ICON_SMALL := 0
ICON_BIG := 1
IMAGE_ICON := 1

$F1::
   hIcon := LoadPicture("Shell32.dll", "Icon5", IMAGE_ICON)
   SendMessage, WM_SETICON, ICON_SMALL, hIcon,, A
   SendMessage, WM_SETICON, ICON_BIG, hIcon,, A
   Return
The code is not mine but it works very reliably.

I dont see how in Autohotkey, I could work with a specific window based on its icon though. I searched around and found nothing on this subject.
I am curious, what did you have in mind with Everything window icon? Do you know of a way to work with it in Autohotkey?

Thanks allot for implementing this feature and for considering per window preprocessor variables and window instance names. I think just those two features would be game changers for me.
hellen_dorandt89
Posts: 52
Joined: Sun Apr 03, 2022 5:52 pm

Re: How to give a window launched from the command line a static title

Post by hellen_dorandt89 »

meteorquake wrote: Fri Dec 09, 2022 8:32 am I'm not sure if the last answer covers you fully (I suspect it may) but another option I would presume is to give the launched item a unique random starting string using nop: (e.g. nop:98723463) then scan the windows to find the window title with that opening's underlying ID, so you can continue to spot it even if the search string gets changed.
d
Hey this is a good idea! I had though of this too. I went down this route and I ended up hating it, I really fight to keep the search bar clear for my sanity and for also the automatic Autohtokey functions that I am testing against the search state.
Thanks for the suggestion though!
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to give a window launched from the command line a static title

Post by void »

Please try the following Autohotkey script:

Code: Select all

~Browser_Back & space::
WinSet, Style, +0x00000800, ahk_class EVERYTHING_(1.5)
WinSetTitle, A, , ahk_class EVERYTHING_(1.5)
Return
Note: Set the style before changing the window title.

(untested)
hellen_dorandt89
Posts: 52
Joined: Sun Apr 03, 2022 5:52 pm

Re: How to give a window launched from the command line a static title

Post by hellen_dorandt89 »

Your code works! The other winodws are unaffected, sadly I think there was some missunderstanding as this gets me there just half way.

What I was hoping to get was, a windows title like :

Code: Select all

%Current_Search% - "My custom title"
So that if the active everything window searchbar is set to
Parent:"C:\Reflect_Install.log"

The active everything window title will be:

Code: Select all

Parent:"C:\Reflect_Install.log" - My custom title

Code: Select all

~Browser_Back & space::
WinSet, Style, +0x00000800, ahk_class EVERYTHING_(1.5)
WinSetTitle, A, , ahk_class EVERYTHING_(1.5)
Return
The above code essentially achieves

Code: Select all

Everything64 -n -define windowtitle="My New title"
but manages to limit the title change to a single window instead of all windows and no search status indication. which is a workable solution on its own. its just that I need a custom title while at the same time having the current search query on the windows title bar as well, so like:

Code: Select all

Parent:"C:\Reflect_Install.log" - My custom title
This is becuase I have Powershell custom modules\Commandlets that relly on everythings title bar in order to know about that windows search status.

I can work with this certainly and I am gratefull to you for helping me. But I really hope we get true per window instance names in the future.

Thanks allot.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to give a window launched from the command line a static title

Post by void »

Everything 1.5.0.1334a removes the 0x800 flag as it may unexpectly prevent the updating of the title bar.

I still have on my TODO list to add "named" windows.
Post Reply