Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Child window with no title
#1
What is most effective way to target a child window with no title and with class "#32770"?
I have 2 windows

(1)  int w1=win("Ant Download Manager v.2.3.2" "#32770")
(2)  int w2=win("" "#32770")

(1) is the main window and (2) is opened when a download is clicked in the browser.

I have this currently, but do not know if it is most effective (and correct).
It works, it depends on detecting "w1" and then the next one in the stack order to be "w2"

EDIT:
Forgot to mention, that I sometimes have other dialogs/windows open with no title but with class "#32770" that's why I want to be sure I am targeting the spawned window from AntDM (and not another window with no title and same class).

Macro ANT__test
Code:
Copy      Help
int w1=win("Ant Download Manager v.2.3.2" "#32770")
int w2=win("" "#32770")
ARRAY(int) a; int i; str sc sn

win("" "" "AntDM" 0 0 0 a) ;; 'AntDM' -> AntDM.exe
if(a.len<2) ;; need to be at least 2 windows open from AntDM
,ret
for(i 0 a.len)
,if((a[i]=w1)&&(a[i-1]=w2))
,,act a[i-1] ;; this targets w2


   
#2
try
Code:
Copy      Help
int w1=win("Ant Download Manager v.2.3.2" "#32770")
int w2=win("" "#32770" "" 0 F"owner={w1}")

or
Code:
Copy      Help
int w1=win("Ant Download Manager v.2.3.2" "#32770")
int w2=win("" "#32770" "" 0 "cText=Download Later")

or combine both: F"owner={w1}[]cText=Download Later"
#3
Thanks!
This works!


Forum Jump:


Users browsing this thread: 1 Guest(s)