AutoHotkey Community

It is currently May 27th, 2012, 12:42 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: December 18th, 2009, 3:30 pm 
Offline

Joined: April 4th, 2009, 9:59 am
Posts: 130
18December2009

Greetings.
I'm wondering about some aspects of AHK's window identifying ...

WinTitles have a WinTitle & an ahk_class.
I would like to quickly be able to identify XP popup windows
of the #32768, #32770, #32771 classes with NO TITLE.
I don't yet know how one could use AHK
to find windows whose WinTitle := ""

Is there some way to use "and" or "or" or some way
to specify multiple/independent Exclude WinTitle/WinText criteria?
Maybe like
IfWinExist, Firefox ahk_class MFF, , gMail or AOL

I've tried using
WinGet, WS2wc, Count, , , ahk_class #32771
or
WinGet, WS2wc, Count, , , ahk_class #32768
but
WinGet, WS2wc, Count, , , ahk_class #32771
or
WinGet, WS2wc, Count, , , ahk_class #32768
have not been excluding the #class windows ...
maybe the WinDelay (@ 0) is set too fast?

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


Last edited by AEN007 on January 5th, 2010, 1:06 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2009, 3:48 pm 
Code:
If WinExist("gMail") || WinExist("AOL")
   MsgBox Bingo


:?:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2009, 8:28 pm 
Offline

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

Still hoping to sometime / somehow clarify these questions.
I don't understand the reply/example.
Where is this technique documented?
In any case that question - restated - is
(How) Can one specify multiple exclude criteria?
If WinExist Firefox but not gMail & not AOL?

What about identifying/counting windows whose WinTitle := ""

WinGet, co, Count, , , ahk_class Notepad
is not excluding Notepad windows.
WinGet, co, Count is not excluding any windows that I specify ...

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2009, 9:50 pm 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
It's possible that AHK Groups may be of interest to you. Alternatively, you can retrieve a list of HWNDs to several windows, and use the other WinGet* commands to get extra information about each window, and narrow down the list with that.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2009, 5:13 am 
Offline

Joined: April 4th, 2009, 9:59 am
Posts: 130
21December2009

Greetings.
Thanks for the reply.
I have not yet had time to consider the responses ...
but I have made some "WinGet, co, Count" progress ...
WinGet, co, Count
is not functionally equivalent to
WinGet, co, Count, , , , ,

I cannot (yet) explain why or even how the second example functions,
but the second example retrieves about 60% of the windows
that the first example does - which retrieves ALL NON-HIDDEN windows.

The second example does not count the Mozilla Firefox browser ...
for example, among other excluded windows -
including many POPUP type (#32768, #32771 ...) which have no title.

Anyone who knows something about this?
This is not the first time I have encounted different/arbitray behaviors
depending on how many trailing commas there are ...

My original questions still remain as well ...

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 3rd, 2010, 9:38 pm 
Offline

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

Greetings.
I wish the AHK Forum was as awesome as AHK is ...

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 4th, 2010, 12:52 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
Code:
GroupAdd, group1, #32768
GroupAdd, group1, #32770      ;with NO TITLE
GroupAdd, group1, #32771
IfWinExist/Active, ahk_group group1

; and

IfWinExist, Firefox ahk_class MFF, , gMail or AOL
;==>
If ( WinExist("Firefox ahk_class MFF",,"gMail") or WinExist("Firefox ahk_class MFF",,"AOL") )

Well there's 1 too many coma there
AEN007 wrote:
WinGet, co, Count
is not functionally equivalent to
WinGet, co, Count, , , , ,


I've never really used the "Exclude" parts
[VxE] wrote:
It's possible that AHK Groups may be of interest to you. Alternatively, you can retrieve a list of HWNDs to several windows, and use the other WinGet* commands to get extra information about each window, and narrow down the list with that


What is it exactly that you are trying to accomplish? (ie the script that you need all this for)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2010, 11:09 am 
Offline

Joined: April 4th, 2009, 9:59 am
Posts: 130
5January2010

Greetings.
"1 too many" commas is not necessarily correct, it seems to me.
How many commas, brackets, etc ... the bane of scripting ...

WinRestore ahk_class OpWindow
WinRestore, ahk_class OpWindow
WinRestore, ahk_class OpWindow,
WinRestore, ahk_class OpWindow, , ,
WinRestore, ahk_class OpWindow, , , ,

are all functionally equivalent ...

WinMove, ahk_class AutoHotkey2, , , , %SpScW%, 23
is not functionally equivalent to the following»
WinMove, ahk_class AutoHotkey2, , , , %SpScW%, 23,
WinMove, ahk_class AutoHotkey2, , , , %SpScW%, 23, SpImOn
... at least that is what I have found ...

In any case I'm not complaining about how
WinGet, co, Count, , , , ,
functions. I don't want to count (most of) the windows it excludes.

WinSize2 is available at SourceForge ... written with AHK ...
I used WS2 for a year & then finally realized how to write my own.
I used absolutely no AHK script from WS2.
I only converted the(my) "data" in the ini file to an AHK data/script file.
I don't want to "compete" with WS2, however ...
I just wanted my own WS2 script that would do exactly what I want ...

I haven't had time, yet, to look at the other scripts you posted.

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


Last edited by AEN007 on January 5th, 2010, 1:08 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2010, 12:54 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
I have done some testing, & it appears that WinGet...ExludeTitle cannot use ahk_class or ahk_group

And this claim of mine is backed-up by... (found this in forum) :)
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
Help wrote:
ExcludeTitle Windows whose titles include this value will not be considered

See also these 2 posts...
Can ahk_group be used in "ExcludeTitle" parameters
How could I get more than 1 ExcludeTitle matches in winhide


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2010, 1:55 pm 
Offline

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

Greetings.
Many thanks for the reply ...

I recently decided to switch back to
WinGet, WS2a1, Count
from
WinGet, WS2a1, Count, , , , ,
because I now know a better way to exclude
windows from the Count that I don't want counted
(e.g., ahk_class #32768, ahk_class #32771, ahk_class BaseBar,
ahk_class ComboLBox, ahk_class tooltips_class32 ... ),
and my script is more effective with a Count that counts all non-hidden windows ...


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

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

Greetings.

I would still like to know how AHK could identify Windows
that have no Title - only an ahk_class (e.g., #32768 & etc ...)
I have tried RegEx MatchMode but still not (yet) succeeded.
Also, how could AHK identify files with no extenstion? e.g., IfExist, *.

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


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

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
- SetTitleMatchMode
- Other Usages of the WinTitle Parameter

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2010, 4:58 am 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6070
Location: San Diego, California
What about the WinText parameter ?

http://www.autohotkey.com/docs/commands/WinGetText.htm
WinGetText, OutputVar [, WinTitle, WinText, ExcludeTitle, ExcludeText]

>>Also, how could AHK identify files with no extenstion? e.g., IfExist, *.
That is impossible as an Ahk command.
It would have to be a written script to read the file and somehow figure out what program generated the file.


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

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

Greetings.

Thanks for the replies, but I have not discerned any solution from the suggestions.
If someone knows the/an answer, maybe they could just spell it out???

Right now I only know of an indirect, two-step way to identify windows with no title.

WinGetTitle, WT
then
If (WT = "")
but I would like to be able to ID titleless windows directly in
IfWinExist, IfWinActive or If WinExist()/WinActive() & etc ...

"DOS" could/does ID files with no extension; e.g., Dir *.
I can't believe AHK cannot.

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2011, 4:51 pm 
Offline

Joined: January 29th, 2009, 9:50 pm
Posts: 483
Location: Belgium
i know its a bit late but it's just for if somebody searches, the answer to this:
AEN007 wrote:
(How) Can one specify multiple exclude criteria?
If WinExist Firefox but not gMail & not AOL?
is here:
Code:
If WinExist("Firefoxl") && !WinExist("gMail") && !WinExist("AOL")
   MsgBox Bingo

_________________
Stopwatch emdkplayer
the code i post falls under the: WTFYW-WTFPL license


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Leef_me, Ohnitiel, XstatyK, Yahoo [Bot] and 14 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