It is currently April 12th, 2021, 4:05 am

A question about WindowMessages's WindowName

Get help with installing and using Rainmeter.
User avatar
Ahnìon
Posts: 19
Joined: December 31st, 2011, 9:34 pm
Location: Norrköping, Sweden

A question about WindowMessages's WindowName

Post by Ahnìon »

Hey there. I've been fiddling with WindowMessage lately and find myself a bit stumped.

Is there any way to find a window name by part of its title rather than the full, exact one? Since many applications change their titles based on state and window classes can be very generic, this seems to limit the functionality quite a lot.

(Edit: brainmelt—used the wrong name.)
death is a sausage! .
User avatar
jsmorley
Developer
Posts: 21614
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: A question about WindowMessages's WindowName

Post by jsmorley »

No, you can't used any kind of wildcards with WindowMessage. I think you are better off finding the "class" name, which is going to be more consistent than the window "title" for many applications.
User avatar
jsmorley
Developer
Posts: 21614
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: A question about WindowMessages's WindowName

Post by jsmorley »

You can use a tool like this:

https://www.nirsoft.net/utils/winlister.html

to find the class names of all open windows.
User avatar
Ahnìon
Posts: 19
Joined: December 31st, 2011, 9:34 pm
Location: Norrköping, Sweden

Re: A question about WindowMessages's WindowName

Post by Ahnìon »

Thanks for the quick answer!

I've used WinLister. The problem is that the generic nature of class names means you might have five windows with the same class.

Having found your WindowState plugin, though. I'm looking at the source and figuring using it as a reference to build a similar tool that returns the window title is a great opportunity to get started with AutoIt. Thanks for including the source! :thumbup:
death is a sausage! .
User avatar
jsmorley
Developer
Posts: 21614
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: A question about WindowMessages's WindowName

Post by jsmorley »

AutoIt also has a tool that comes with it that can be used to point at any open window to give you lots of information...

Au3Info_x64.exe
User avatar
Ahnìon
Posts: 19
Joined: December 31st, 2011, 9:34 pm
Location: Norrköping, Sweden

Re: A question about WindowMessages's WindowName

Post by Ahnìon »

Thanks for the tip!

Looks like I have a working tool, although I just laughed for a bit at the fact that it just found my console window rather than the one I was aiming for.
death is a sausage! .