Functionality: It Works for IE6 IE7 and IE8 - Maximize Browser
______
Function BrowserMaximize (optsBrwName)
Set BrwDesc = Description.Create()
BrwDesc("micclass").Value = "Browser"
rcBrwCount = fGetBrowsersCount()-1
UnKnown_hwnd=Browser("CreationTime:="& rcBrwCount).GetROProperty("hwnd")
Get_title= Window("hwnd:="& UnKnown_hwnd).GetROProperty("title")
Get_name = Window("hwnd:="& UnKnown_hwnd).GetRoProperty("name")
Get_openurl = Window("hwnd:="& UnKnown_hwnd).GetRoProperty("openurl")
If Get_title = "" AND Get_name = "" Then
SetProperty = "openurl"
Else
SetProperty = "title"
End If
BrwDesc(SetProperty).Value = optsBrwName
If Get_title ="" AND Get_name = "" AND Get_openurl="" Then
Reporter.ReportEvent micFail,"DID NOT Opens the Child Window - NONE of the Properties name/openurl/title were assigned to the ChildWindow ","Choose another property to Perform Action on opened Child Window"
Else
Reporter.ReportEvent micPass,"Recognized the Child Window by using the property '" & SetProperty & "' ","Performs an Action MAXIMIZE on opened Child Window"
SetProperty1=SetProperty & ":=" & optsBrwName
Dim hwndBrw, hwndWindow
hwndBrw = Browser(SetProperty1).GetROProperty("hwnd")
Const GA_ROOT = 2
Extern.Declare micLong,"GetMainWindow", "user32" ,"GetAncestor",micLong, micLong
'Get the main IE window handle
hwndWindow = Extern.GetMainWindow(hwndBrw, GA_ROOT)
Window("hwnd:=" & hwndWindow).Maximize
End If
Set BrwDesc = Nothing
End Function
------------------------------------------------------------
Function fGetBrowsersCount()
Set ObjIExpl = Description.Create
ObjIExpl("micclass").value = "Browser"
Set ObjIExplColl = Desktop.ChildObjects(ObjIExpl)
fGetBrowsersCount = ObjIExplColl.Count
End Function
---------------------------------------
No comments:
Post a Comment