AutoHotkey Community

It is currently May 26th, 2012, 6:28 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: March 19th, 2005, 2:43 pm 
Offline

Joined: February 25th, 2005, 5:05 pm
Posts: 11
Location: Germany
This doesn't match the Thunderbird Compose window, but why ...
It's intended to specify the window as exact as possible.
Code:
IfWinActive, ahk_class MozillaWindowClass, Compose:


What's my mistake/misunderstanding ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 3:54 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
My guess is the problem lies with "Compose:" - I might be wrong, try running WinSpy and see what comes up. I've found with some windows, even though the text is visible to me, it doesn't necessarily show up in WinSpy. It should be able to create a match based on text seen by WinSpy.

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 4:48 pm 
Offline

Joined: February 25th, 2005, 5:05 pm
Posts: 11
Location: Germany
Of course I've already checked that - looks good :(
I'm a bit doubtful concerning the use of ahk_class in conjunction with the WinText part...
Anyway - I use this as an workaround for the time being:
Code:
  IfWinActive, ahk_class MozillaWindowClass
  {
    WinGetActiveTitle, Title
    IfInString, Title, Compose:
    {
       ...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 5:48 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
Quote:
Code:
    WinGetActiveTitle, Title
    IfInString, Title, Compose:


You know, you'd get the exact same effect here by setting the title match mode to two using SetTitleMatchMode and IfWinActive. Look 'em up! 8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 6:03 pm 
Offline

Joined: February 25th, 2005, 5:05 pm
Posts: 11
Location: Germany
Right jonny - tried that already. Missed that in my 1st code snippet.
But as I wrote: no match ... double checked w/ Window Spy - everything looks fine - no idea :(
Is there a problem using 'ahk_class <class>, <WinText>' as win spec. ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 6:35 pm 
Offline

Joined: February 25th, 2005, 5:05 pm
Posts: 11
Location: Germany
I re-read the help again (and again):
Quote:
WinText: If present, this parameter must be a substring from a single text element of the target window. Hidden text elements are detected if DetectHiddenText is ON.

hmm... I did a WinGetText on my window and it was empty.
I think WinText has obviously nothing to do w/ the title, but what is it ???


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 7:27 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
WinText is text that appears beneath a window's title bar. More specifically, it is the captions of all controls in the window. You can discover a windows exact WinText with Window Spy (or using WinGetText as you did).

It is possible to use ahk_class and WinText together, but not ahk_class+title (but this is a good suggestion if only there were some way to do it without breaking existing scripts).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 8:21 pm 
Offline

Joined: February 25th, 2005, 5:05 pm
Posts: 11
Location: Germany
Thanks Chris, that's the explanation I was looking for.
Anyway, it's not a big deal 'cause doing
Code:
IfWinActive, ahk_class <AHK_CLASS>
  IfWinActive, <title-string>
  { ...

is good code too.
And nobody wants to break existing code w/o a GOOD reason ;)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: bobbysoon, Exabot [Bot], Google [Bot], JSLover, kkkddd1, Tipsy3000, Yahoo [Bot] and 70 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