Using VBScript is it possible to close an HTA if the HTA loses focus? For
example, if the user clicks onto any other app outside the currently loaded
HTA?

Thanks much in advance.

Re: Close HTA if focus is lost by ThatsIT

ThatsIT
Thu Jan 31 07:29:45 CST 2008

onblur()

"XP" <XP@discussions.microsoft.com> wrote in message
news:626767A9-ADDE-45D8-866A-96DEA363BFF9@microsoft.com...
> Using VBScript is it possible to close an HTA if the HTA loses focus? For
> example, if the user clicks onto any other app outside the currently
> loaded
> HTA?
>
> Thanks much in advance.

<html>
<head>
<script language="javascript" type="text/javascript">
<!--

function window_onblur() {
window.close()
}

// -->
</script>
</head>
<body onblur="return window_onblur()">
</body>
</html>