03-26-2012, 06:02 PM
OK, restarting QM did it, strange behavior.
Now: calling function
type TABPROP str'name str'url int'index
ARRAY(TABPROP) tabs
OngletsFirefoxType(0 tabs)
for _i 0 tabs.len
out tabs[_i].name
out "==========================="
for _i 0 tabs.len
out tabs[_i].index
if(!tabs[_i].index)
out tabs[_i].name
out "------------"
function# hwndFF ARRAY(TABPROP)&tabs
if(!hwndFF) hwndFF=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804); if(!hwndFF) ret -1
int i=0
int r=-1
Acc a.Find(hwndFF "PAGETAB" "" "class=MozillaWindowClass" 0x1004)
rep
if(a.Role!ROLE_SYSTEM_PAGETAB) goto next ;;[ + ] button
tabs[].name=a.Name
if(r<0 and a.State&STATE_SYSTEM_SELECTED) tabs[].index=i
next
a.Navigate("n"); err break
i+1
output :
===========================
google.fr
===========================
google.fr
===========================
google.fr
===========================
google.fr
===========================
0
------------
0
------------
2
empty, should be google.fr here as it is the third tab selected - why empty????
------------
0
------------
Now: calling function
type TABPROP str'name str'url int'index
ARRAY(TABPROP) tabs
OngletsFirefoxType(0 tabs)
for _i 0 tabs.len
out tabs[_i].name
out "==========================="
for _i 0 tabs.len
out tabs[_i].index
if(!tabs[_i].index)
out tabs[_i].name
out "------------"
function# hwndFF ARRAY(TABPROP)&tabs
if(!hwndFF) hwndFF=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804); if(!hwndFF) ret -1
int i=0
int r=-1
Acc a.Find(hwndFF "PAGETAB" "" "class=MozillaWindowClass" 0x1004)
rep
if(a.Role!ROLE_SYSTEM_PAGETAB) goto next ;;[ + ] button
tabs[].name=a.Name
if(r<0 and a.State&STATE_SYSTEM_SELECTED) tabs[].index=i
next
a.Navigate("n"); err break
i+1
output :
===========================
google.fr
===========================
google.fr
===========================
google.fr
===========================
google.fr
===========================
0
------------
0
------------
2
empty, should be google.fr here as it is the third tab selected - why empty????
------------
0
------------
