怎样最大化一个Browser

非Tab模式:

Hwnd = Browser("X").object.HWND

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

Tab模式:

Dim hwndBrw, hwndWindow

hwndBrw = Browser("Browser").GetROProperty("hwnd")

Const GA_ROOT = 2

'Declare Function GetAncestor Lib "user32.dll" (ByVal hwnd As Long, ByVal gaFlags As Long) As Long

Extern.Declare micLong, "GetMainWindow", "user32", "GetAncestor", micLong, micLong

 

'Get the main IE window handle

hwndWindow = Extern.GetMainWindow(hwndBrw, GA_ROOT)

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

posted @ 2012-09-06 08:54  dushuai  阅读(143)  评论(0编辑  收藏  举报