Sunday, June 13, 2010

Maximize the Browser using QTP

Option Explicit

Dim IE, hWnd
Set IE=createobject("Internetexplorer.application")
IE.visible=True
IE.Navigate2 "http://www.gmail.com"

'********* The below line gives you the handle window property for browser ************ But it will not work to make the browser maximize
msgbox Browser("micclass:=Browser").GetROProperty("hwnd")

' ********* The below line give you the handle window property for window ************ which will be used to make the browser window maximize
hWnd=Browser("micclass:=Browser").Object.hwnd
msgbox hWnd

Window("hwnd:=" & hWnd).Maximize

No comments:

There was an error in this gadget