|
5#
楼主 |
发表于 2005-9-1 13:27:38
|
只看该作者
有些ie关闭,可能会有个提示或登陆对话框,虽然会得到有ie窗口,却关不掉,因此,window winclose会包错
Function CloseIEWindows() As Integer
On Error GoTo ErrorHandler
static TIMELIMIT as Integer
dim StartTime,EndTime as Long
TIMELIMIT=5
StartTime=timer
do while SQAFindObject("\;Type=Window;Caption={*Microsoft Internet Explorer*}") = sqaSuccess
Window CloseWin, "Caption={*Microsoft Internet Explorer*}",""
EndTime=timer
if(EndTime<StartTime) then
StartTime=0
end if
if(EndTime-StartTime>=TIMELIMIT) then
exit do
end if
loop
CloseIEWindows= 1
Exit Function
ErrorHandler:
sqaLogMessage sqaWarning, Error$, ""
End Function |
|