WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Find Current MSIE Window Object Handle


Basically you have to loop thru all the explorer windows that are open and find the ones that belong to MSIE.
Winbatch Version: 2005B -- Script by Jay Alverson




;   this will find the first MSIE it comes across
;   and return it for the script to manipulate...

;   you'd have to change it so that it returns an
;   array of each MSIE window it finds...

#DefineFunction CheckForBrowser()
   retval = 0
   Shell = ObjectOpen("Shell.Application")
   For x = 0 To Shell.Windows.count-1
         If StrIndexNC(Shell.Windows.item(x).Name, "Microsoft Internet Explorer", 1, @FWDSCAN)
         Return(Shell.Windows.item(x))
         Break
      EndIf
   Next
   Message("Debug", "No MSIE on screen!")
   Return
#EndFunction


;   start MSIE by hand first...

ie = CheckForBrowser()

Message("Debug", ie.locationURL)

Exit

Article ID:   W17174
File Created: 2007:07:03:14:28:36
Last Updated: 2007:07:03:14:28:36