 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
AEN007
Joined: 04 Apr 2009 Posts: 129
|
Posted: Fri Dec 18, 2009 2:30 pm Post subject: AHK & Identifying Windows |
|
|
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 Tue Jan 05, 2010 12:06 pm; edited 1 time in total |
|
| Back to top |
|
 |
BoBo³ Guest
|
Posted: Fri Dec 18, 2009 2:48 pm Post subject: |
|
|
| Code: | If WinExist("gMail") || WinExist("AOL")
MsgBox Bingo |
 |
|
| Back to top |
|
 |
AEN007
Joined: 04 Apr 2009 Posts: 129
|
Posted: Sun Dec 20, 2009 7:28 pm Post subject: |
|
|
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
Æ |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 3254 Location: Simi Valley, CA
|
|
| Back to top |
|
 |
AEN007
Joined: 04 Apr 2009 Posts: 129
|
Posted: Mon Dec 21, 2009 4:13 am Post subject: |
|
|
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
Æ |
|
| Back to top |
|
 |
AEN007
Joined: 04 Apr 2009 Posts: 129
|
Posted: Sun Jan 03, 2010 8:38 pm Post subject: |
|
|
3January2010
Greetings.
I wish the AHK Forum was as awesome as AHK is ...
Any helpful/replies insights appreciated.
Thank you.
Regards,
AEN
Æ |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 626
|
Posted: Mon Jan 04, 2010 11:52 am Post subject: |
|
|
| 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) |
|
| Back to top |
|
 |
AEN007
Joined: 04 Apr 2009 Posts: 129
|
Posted: Tue Jan 05, 2010 10:09 am Post subject: |
|
|
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 Tue Jan 05, 2010 12:08 pm; edited 1 time in total |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 626
|
Posted: Tue Jan 05, 2010 11:54 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
AEN007
Joined: 04 Apr 2009 Posts: 129
|
Posted: Sat Mar 06, 2010 12:55 pm Post subject: |
|
|
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 ... |
|
| Back to top |
|
 |
AEN007
Joined: 04 Apr 2009 Posts: 129
|
Posted: Sat Mar 20, 2010 11:53 am Post subject: |
|
|
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
Æ |
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5334 Location: San Diego, California
|
Posted: Sun Mar 21, 2010 3:58 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
AEN007
Joined: 04 Apr 2009 Posts: 129
|
Posted: Mon Mar 29, 2010 11:14 am Post subject: |
|
|
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
Æ |
|
| Back to top |
|
 |
emmanuel d
Joined: 29 Jan 2009 Posts: 436 Location: Belgium
|
Posted: Thu Aug 04, 2011 3:51 pm Post subject: |
|
|
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
http://www.autohotkey.com/forum/viewtopic.php?p=306819
the code i post falls under the:
WTFYW license
, wich meens its free to use |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|