Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tweak GetChildObjects routine
#5
Member function Acc.FindFirefoxWebRoot
Code:
Copy      Help
function `hwnd

;Gets root object of current web page in Firefox.


#if QMVER<0x2030400
Find(hwnd "" "" "" 0x3000 0 0 "parent")
#else
Find(hwnd "" "" "" 0x3000)
#endif

err+ end _error

Example. Replaced only the Acc a.Find... line.
Macro Macro1862
Code:
Copy      Help
out
;get name/URL of all Firefox tabs
int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804)
Acc a.FindFirefoxWebRoot(w); a.Navigate("parent3")
ARRAY(Acc) b; int i
a.GetChildObjects(b 2 "DOCUMENT" "" "" 16) ;;get all child DOCUMENT at level 2, including hidden
for i 0 b.len
,out "--------"
,out b[i].Name ;;page name
,out b[i].Value ;;page URL
,if(b[i].State&STATE_SYSTEM_INVISIBLE=0) out "<visible>"

In FirefoxGetTabs replace line a.Find(hwndFF "DOCUMENT"... with:
Function FirefoxGetTabs
Code:
Copy      Help
a.FindFirefoxWebRoot(hwndFF); a.Navigate("pa3fi")


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)