Thread Rating:
  • 2 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help about CreateObject
#7
Not Solved
Hi,
my aim was to use a function to create an IE object, then identify hwnd property to send it to the calling script for other functions. The use of runutility ie.explore is not exactly right for me, because my browser must have a certain website pre-imposted, so if i had already opened a browser and i wanted to open another browser, with runutility i would have problems to recognize new browser (i use the name/title property to recognize the browser). Howewer, I have found the solution with a function like this:

Code:
Function FunOpenBrowser()
    
    dim objexpl, brow, pag, hwnd(1)
    set objexpl = CreateObject("InternetExplorer.Application")
    objexpl.visible = true
    objexpl.navigate "http://www.google.it"
    wait(5)
    
    Set brow  = Browser("hwnd:=" & objexpl.hwnd)
    Set pag   = brow.Page("title:=" & objexpl.Document.Title)
    brow.sync
    wait(5)

    hwnd(0)  = brow.getroproperty("hwnd")
    hwnd(1)  =  pag.getroproperty("hwnd")
    
    Reporter.ReportEvent 0, "FunOpenBrowser", "hwnd browser: " & hwnd(0) & vbcr & "  hwnd page: " & hwnd(1)
    
    FunOpenBrowser = hwnd
    
    Set objexpl = nothing
    
End Function

bye
Reply


Messages In This Thread
help about CreateObject - by stevol - 05-29-2008, 01:20 PM
RE: help about CreateObject - by Ankur - 05-29-2008, 04:26 PM
RE: help about CreateObject - by stevol - 05-30-2008, 05:20 PM
RE: help about CreateObject - by chrissolinsky - 11-23-2011, 08:28 PM
RE: help about CreateObject - by Ankur - 05-30-2008, 11:28 PM
RE: help about CreateObject - by anemuday - 07-17-2008, 11:30 AM
RE: help about CreateObject - by vineet1234 - 01-08-2009, 11:39 AM
RE: help about CreateObject - by stevol - 01-13-2009, 03:54 PM
RE: help about CreateObject - by SUSHEEL_VIG - 07-26-2009, 09:03 PM
RE: help about CreateObject - by tkmseie - 11-19-2009, 07:21 PM
RE: help about CreateObject - by arunshuklainbox - 01-25-2016, 02:48 PM
RE: help about CreateObject - by rajpes - 07-30-2011, 07:13 AM
RE: help about CreateObject - by sreeswetha - 08-19-2011, 12:51 AM
RE: help about CreateObject - by s_shiva - 11-23-2011, 11:16 AM
RE: help about CreateObject - by atul2038 - 09-23-2011, 05:34 PM
RE: help about CreateObject - by Ankur - 09-23-2011, 05:51 PM
RE: help about CreateObject - by shivu.impu - 02-17-2012, 01:23 PM
RE: help about CreateObject - by vinod123 - 11-19-2015, 02:08 PM
RE: help about CreateObject - by smiley - 10-04-2016, 08:38 AM
RE: help about CreateObject - by arunshuklainbox - 10-04-2016, 09:22 AM
RE: help about CreateObject - by arunshuklainbox - 10-04-2016, 09:26 AM
RE: help about CreateObject - by metaforum - 05-14-2018, 02:28 PM
RE: help about CreateObject - by preethishetty - 08-02-2018, 12:36 PM
RE: help about CreateObject - by swethareddy - 04-16-2019, 11:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Detail info about createObject() nandu 1 4,116 11-30-2010, 10:36 AM
Last Post: Saket
  Need list of "objects" used in qtp by using "CreateObject" SaranKumarV 2 15,536 09-15-2010, 05:03 PM
Last Post: SaranKumarV
  What is the exact meaning of CreateObject() Rajashekar Gouda 1 5,354 01-17-2008, 02:37 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 11 Guest(s)