Jump to content
Sign in to follow this  
jvanegmond

Advanced Window Description just for backwards compatibility?

Recommended Posts

jvanegmond

I just went over the latest help file and noticed that mode 4 of WinTitleMatchMode, the advanced window description, is only kept for backward compatibility. This seems rather incorrect to me, because it is one of the most simple matching modes available.

I used it a lot to, for example, get the active window handle using [ACTIVE] or match windows based on a class or a regular expression. I just thought I'd ask about this before I make some dumb comments when I make the wrong assumptions.

Edited by Manadar

Share this post


Link to post
Share on other sites
SmOke_N

I just went over the latest help file and noticed that mode 4 of WinTitleMatchMode, the advanced window description, is only kept for backward compatibility. This seems rather incorrect to me, because it is one of the most simple matching modes available.

I used it a lot to, for example, get the active window handle using [ACTIVE] or match windows based on a class or a regular expression. I just thought I'd ask about this before I make some dumb comments when I make the wrong assumptions.

remember it used to be:

classname=

regextitle=

That's the backwards compatibility it's talking about.

You don't even need to state TitleMode 4 if you use [CLASS:#32770] (example only) anymore.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Jos

What are you reading into this statement?

1. Opt("WinTitleMatchMode", 4) is kept for backward compatiblility?

2. Advanced Window Descriptions is kept for backwards compatibility?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
jvanegmond

That is awesome!

The help file text still confused me a bit. What is meant by ..

Must be replaced with Advanced Window Descriptions which does not need any mode to be set.

@Jos, I'm not sure actually. A bit of both I think, but mostly option #2.

Edited by Manadar

Share this post


Link to post
Share on other sites
Jos

I read option 1: which mean that you do not have to set Opt("WinTitleMatchMode", 4) when using the new advanced notation but it is kept for the old notation.

:)

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
jvanegmond

I understand that now, that is obviously the correct way of reading it.

What strikes me as odd is that the part about window handles has a text that says it will work no matter the current mode of operation.

"Note: Window handles will work no matter what WinTitleMatchMode is currently in use." However, advanced window descriptions does not.

So ....

Note: Advanced Window Descriptions will work no matter what WinTitleMatchMode is currently in use. ?

Also, I still don't really understand what is ment by

Must be replaced with Advanced Window Descriptions which does not need any mode to be set.

I'm not trying to get this updated just because it wasn't immediately clear to me. I understand there are more people, and if the majority says it's obvious then I'll just shut up for a bit.

Share this post


Link to post
Share on other sites
SmOke_N

I understand that now, that is obviously the correct way of reading it.

What strikes me as odd is that the part about window handles has a text that says it will work no matter the current mode of operation.

"Note: Window handles will work no matter what WinTitleMatchMode is currently in use." However, advanced window descriptions does not.

So ....

Note: Advanced Window Descriptions will work no matter what WinTitleMatchMode is currently in use. ?

Also, I still don't really understand what is ment by

I'm not trying to get this updated just because it wasn't immediately clear to me. I understand there are more people, and if the majority says it's obvious then I'll just shut up for a bit.

Advanced Window Descriptions

A special description can be used as the window title parameter. This description can be used to identify a window by the following properties:

TITLE - Window title

CLASS - The internal window classname

REGEXPTITLE - Window title using a regular expression (if the regular expression is wrong @error will be set to 2)

REGEXPCLASS - Window classname using a regular expression (if the regular expression is wrong @error will be set to 2)

LAST - Last window used in a previous AutoIt command

ACTIVE - Currently active window

X \ Y \ W \ H - The position and size of a window

INSTANCE - The 1-based instance when all given properties match

You don't need to use Opt("WinTitleMatchMode", n) when using those Advanced styles.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×