AutoHotkey Community

It is currently May 27th, 2012, 5:34 am

All times are UTC [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 14 posts ] 
Author Message
 Post subject: Exclude Text Problems
PostPosted: March 8th, 2010, 3:49 pm 
Offline

Joined: April 4th, 2009, 9:59 am
Posts: 130
8March2010

Greetings.
Once again I am encountering Exclude Text problems ...
(I suppose some helpful guest might reply that I should stop whining?)

I have encountered more than once that AHK does
not exclude text that the documentation says AHK should ...
AHK has incredible documentation but sometimes
the documentation is not clear (to me) ...
My understanding is that
MatchMode Slow/Fast, 1/2/3 and DetectHiddenText (DHT)
affect how/what AHK detects as window text.

The WindowSpy shows Visible/Hidden & MatchMode Slow text.
AHK should detect all/any text with MatchMode Slow/2 & DHT On.

My most recent problem is with the Configuration window for The Clock
http://www.softpedia.com/get/Others/Mis ... lock.shtml
(freeware & install-free / only one release and no longer supported ...)

WinGetText, OV, WinTitle/Class retrieves all text that the WSpy shows
but WinMove (for example) does not "catch" any/all exclude text
that I understand WinMove should -
no matter if MM is slow/fast 1/2/3 or DHT is On or Off ...

AHK only seems to detect the FIRST text element listed under visible text.
WSpy lists a different text element first for each tab of TheClock configuration ...
This is not the first time that AHK has only detected the first text element listed -
regardless of MM 1, 2 or 3; Slow or Fast, DHT On or Off

WSpy says TheClock config window has only one hidden text element,
but AHK WinMove would not exclude the window with DHT On ...

I would be interested to hear/discuss anyone else's experience
with AHK & The Clock Configuration window ... for example

Any helpful replies/insights appreciated.
Thank you.
Regards,
AEN
Æ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2010, 4:27 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
The title of the window is 'Configuration', there's no other text in the window title to exclude. I can move the window fine with this:

Code:
WinMove, Configuration, , 0, 0


So if that's not your issue you need to please be sure to state exactly your problem is and provide code so we can see what you're doing versus what you're expecting.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 8th, 2010, 8:19 pm 
AEN007 wrote:
(I suppose some helpful guest might reply that I should stop whining?)

...no, but I would like to know why...

Every single post by AEN007 wrote:
8March2010

Greetings.

...snip...

Any helpful replies/insights appreciated.
Thank you.
Regards,
AEN
Æ

...is it really necessary to start & end each post with the same useless text?...just wondering...

Including the date is just unnecessary (& you use that inside-out-with-no-spaces format "8March2010" which is annoying) & the stuff at the bottom could just as well be moved to the real sig...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2010, 10:35 am 
Offline

Joined: April 4th, 2009, 9:59 am
Posts: 130
10March2010

Greetings.

I totally forgot to mention MatchMode RegEx.
I thought maybe someone would jump all over the posting about that ...
I only use RegEx in exceptional situations. RegEx is fun.
I tried RegEx with The Clock exclude text to no avail.

sinkfaze wrote:
The title of the window is 'Configuration', there's no other text in the window title to exclude


Excuse me but my understanding is that WinTitle and WinText are
totally separate and distinct. (I can't believe I have to state that ...)
"The Clock" Config window has TONS of text.
For example WSpy lists "UTC" as visible text for each tab even though
"UTC" only appears as text on the last tab ...

On one of my XP laptops I want a (Persistent) script to move all windows
(that might open at any time) with Config in the TiTLE (except "The Clock") to -5, 55.
I should be able to distinguish "The Clock" config window
from all other windows with Config in the TiTLE by using
Code:
SetTitleMatchMode 2
SetTitleMatchMode Fast
WinMove, Config, ,-5, 55, , , , UTC

but AHK "exclude text" does NOT catch "UTC" as text
in "The Clock" Config window even though WSpy says it should ...
AHK "exclude text" only catchs the first text element listed by WSpy.
"The Clock" Config window has five tabs without a common first text element ...

It seems to me that AHK "exclude text" DOES NOT work like I understand that it should ...

Any helpful replies/insights appreciated.
Thank you.
Regards,
AEN
Æ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2010, 7:23 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
Are you sure AHK is supposed to catch it? The window text changes in the configuation window depending on which tab you are viewing. As far as I can tell 'UTC' exists only when you are under the Atomic Time tab, so if that tab isn't active when you execute that script it isn't going to work.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 11th, 2010, 12:27 pm 
Offline

Joined: April 4th, 2009, 9:59 am
Posts: 130
11March2010

Greetings.

1) WSpy seems have a problem/BUG with its visible text -
at least when spying on certain types of tabbed windows.

I just discovered the following »
WSpy lists as visible text all text from the active tab
PLUS ALL TEXT from any/all previously viewed tabs!
WSpy does this with The Clock tabbed window,
the XP StartMenu & Taskbar tabbed window,
the XP Display tabbed window ...

WinGetText does not have that problem.

2) My point regarding the AHK exclude text BUG still remains!
Pick any (correct/actual) visible "TEXT" item
OTHER THAN THE FIRST TEXT ITEM WSpy lists for the active tab.

Try
WinMove, Config, "TEXT",-5, 55
then try
WinMove, Config, ,-5, 55, , , , "TEXT"

WinMove with include text will work but WinMove with the same exclude text will NOT.

Then try the same with "TEXT" as the first text item that WSpy lists.
AHK WinMove will then work correctly with the TEXT as either include or exclude text ...

It seems to me that AHK "exclude text" DOES NOT work like I understand that it should ...
I hope/wish the right person @ AHK woulld address this(these) issue(s).

Any helpful replies/insights appreciated.
Thank you.
Regards,
AEN
Æ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2010, 3:44 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
After briefly looking through the relevant sections in the source code (WinExist, EnumParentFind, WindowSearch::IsMatch and EnumChildFind), I believe it currently "works" like this:
  • Commands call ::WinExist() to resolve the WinTitle etc. to a window handle.
  • WinExist calls EnumParentFind once for each top-level window, via EnumWindows.
  • EnumParentFind calls IsMatch to determine if the current candidate is a match.
  • IsMatch checks the title; if the title matches, it calls EnumChildFind once for each child window (control) of the current candidate top-level window, via EnumChildWindows.
    Where aWnd is the handle of the current child window:
  • EnumChildFind compares aWnd's text to the ExcludeText; if the excluded text is found, it stops enumeration (IsMatch returns false). Otherwise, if WinText is empty or matches aWnd's text, it sets mFoundChild=aWnd and stops enumeration (IsMatch returns true).
In other words, the first child window which contains the WinText or ExcludeText determines whether the parent window is considered a match. Instead, I think EnumChildFind should do this:
  • If aWnd's text matches ExcludeText, set mFoundChild=NULL and stop enumeration. IsMatch will return false.
  • If mFoundChild has not yet been set and aWnd's text matches WinText, set mFoundChild=aWnd and continue enumeration.
In other words, after finding the first matching child window, enumeration continues to ensure that no other child windows contain ExcludeText. (Edit: See patch.)


Since this bug has (presumably) been around so long, I assume very few users actually use the ExcludeText parameter. A while back I tried using a RegEx - when it didn't work, I assumed RegEx wasn't supported in ExcludeText. I now know that TitleMatchMode RegEx is supported for WinText/ExcludeText, but match modes 1 and 3 aren't supported: "for backward compatibility" they act like mode 2.

Also note that as explained above, WinText/ExcludeText must match text from any single control, not the text of all controls as shown in Window Spy.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2010, 12:50 pm 
Offline

Joined: April 4th, 2009, 9:59 am
Posts: 130
20March2010

Greetings.
Thanks for the reply.

I still stand by what I have stated above/previously.

1) WSpy seems have a problem/BUG with its visible text -
at least when spying on certain types of tabbed windows.

2) I have encountered more than once that AHK does
not exclude text that the documentation says AHK should ...

I was already aware that ExcludeTitle/Text were orphan AHK children.
http://www.autohotkey.com/forum/viewtop ... highlight=

It seems to me that AHK should take some action regarding my two points above.
I would prefer that AHK would fix WSpy & ExcludeText.
IncludeText catches any/all actually visible text per MatchMode.
ExcludeText does NOT.
Quote:
Windows whose text include this value will not be considered.

All of the related AHK documentation regarding ExcludeText
is incorrect, inaccurate - misleading. The AHK WSpy documentation
does not account for the "TabbedWindowBug".

It is not clear to me why you state the following»
Lexikos wrote:
Also note that as explained above, WinText/ExcludeText must match text from any single control, not the text of all controls as shown in Window Spy.

Nothing I have previously posted infers anything of the sort.

Any helpful replies/insights appreciated.
Thank you.
Regards,
AEN
Æ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2010, 2:11 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
You will get no-where by repeating yourself, especially when I've already reaffirmed your (ExcludeText) point and shown how it could be fixed. It is up to Chris to take action.
Quote:
It is not clear to me why you state the following»
I mentioned it for the benefit of all users reading this topic; because it is related and contrary to what the documentation implies, and because I noticed it while investigating the issue you reported.
Quote:
I was already aware that ExcludeTitle/Text were orphan AHK children.
http://www.autohotkey.com/forum/viewtop ... highlight=
Firstly, your statement makes little sense; I assume you mean you were aware that text elements/controls/child windows are scanned independently, not the window's text as a whole like the documentation implies. Secondly, the thread you've linked contains nothing to back up your claim as far as I can tell.

Regarding Window Spy,
Chris wrote:
ahk2exe, AutoScriptWriter, and Window Spy are 99% the work of the AutoIt authors Jon and Larry.
Source: Three thumbs up!
As far as I know, the source code for Window Spy is not available. This is why I did not comment on or test your claim. I recommend you use AHK Window Info instead. Its behaviour should be identical to other AutoHotkey scripts.
AEN007 wrote:
The AHK WSpy documentation
Does it even exist?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2010, 9:00 am 
Lexikos wrote:
It is up to Chris to take action.

...not exclusively for this topic/issue, but since Chris is currently inactive, could one of you (the devs of the side-AutoHotkey builds) E-mail Chris & ask to quasi-take-over main AutoHotkey? Maybe only including mini-patches like this?

You can already compile your AHKL, so I would assume you could compile vanilla AHK, with this & other minor patches...or whatever patches Chris approves, depending on if he has time (or the desire) to approve patches.

You would need write access to the website to accomplish this, without having to wait on him to push each change. If he's taking a step back, I would assume he could choose someone to trust with this access (Lexikos?)...or he could even just "bless" AHKL as "main AutoHotkey" (by linking to you on the download page or giving you write access to the server/the download page/a directory) until (& if) he returns?

AutoHotkey is getting stale & I have not tried any of the side dishes yet.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2010, 12:08 pm 
Offline

Joined: April 4th, 2009, 9:59 am
Posts: 130
29March2010

Greetings.

This weekend I found that AHK does detect text on not visible tabs
IF those tabs have been previously active!
I guess that is why WSpy works the way it does.
I was redoing my script for launching/running the XP cleanmgr.
Text on the second tab (include NOT exclude - of course)
would not be detected until after the second tab had been active at least once.

I wish AHK exclude title would do ahk_class/ID/PID & etc like include title does.

Thank you.
Regards,
AEN
Æ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2010, 4:36 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Chris wrote:
ExcludeTitle doesn't support ahk_pid and similar things. All it does is what the help file says: "Windows whose titles include this value will not be considered." The reason for this is that the added code size doesn't seem justified given how rarely ExcludeTitle is used.

Early on in the project, Chris considered eliminating the feature entirely. It was never intended to have full functionality and will not be updated.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2010, 5:59 pm 
Offline

Joined: April 4th, 2009, 9:59 am
Posts: 130
3April2010

Greetings.
Thanks for the reply.

OK ... whatever ...
It seems (to me) that identifying windows is at the heart/core of what AHK is/does.
The better ExcludeTitle/Text work - the better AHK works.
This resistance to ExcludeTitle/Text functionality seems counterproductive to me.

The AHK ExcudeText documentation is incorrect/inaccurate/misleading
in that ExcludeText does not catch any/all text items like IncludeText does.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2010, 6:37 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Until such time as the documentation is updated, anyone with questions regarding ExcludeText should be pointed to this thread, to see the more thorough explanation by Lexikos. The behavior is now unofficially documented.

[This thread is locked. ~jaco0646]


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 14 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group