HTA application closing
Hi,
I have a HTA app that prompts the user whether he would like to Continue or Cancel when closing the window with the sys menu Close (X) button. Since I installed IE7, the app will always close even if the user clicks cancel. I've provided an example of test HTA app where this problems occurs in IE7:
<HTML>
<HEAD>
<TITLE>mytesthta</TITLE>
<HTA:APPLICATION ID="test"
APPLICATIONNAME="testhta"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
BORDER="normal"
BORDERSTYLE="normal"
INNERBORDER="yes">
</HEAD>
<script>
function runthis()
{
event.returnValue="test text to show prompt";
}
</script>
<BODY onbeforeunload="runthis()">
hello world
</BODY>
</HTML>
Run the hta, click (X) close button and then cancel. The app still closes.
Any advice please?!
[1029 byte] By [
jan_bp] at [2008-1-10]
We have a large number of clients using our .hta program with IE7 and are also experiencing the same thing. Our clients that run IE6 do not experience this issue.
I hope this is a hot fix soon. I can't find any KB in MSDN about it though at the moment.
(I just tried Vista + IE7 and it fails then, too).
Hi Jan,
Here is a Header from a HTA that has been used by over 3000 IE7 XP and Vista users from an internet download,without problems
Code Snippet
<html STYLE="HEIGHT:300; WIDTH:400; TOP:10; LEFT:10;">
<!--
Copyright (c) Eye Can Publishing 2007
Contact: support@iecustomizer.com
Homepage: http://www.iecustomizer.com/?url=IE7TBTweaks_Download.asp
-->
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IE7 Toolbar Options</title>
<HTA:APPLICATION ID="IE7TBTweaks"
applicationName="IE7 Toolbar Options"
version="1.1"
BORDER="thin"
BORDERSTYLE="raised"
CAPTION="Yes"
CONTEXTMENU="no"
ICON="IE7.ico"
INNERBORDER="no"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
NAVIGATABLE="no"
SCROLL="yes"
SCROLLFLAT="no"
SELECTION="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
WINDOWSTATE="normal"
>
</head>
I don't know what is going on with your installation... make sure from windows explorer that your file association for extensions hta is for 'Microsoft HTML Application Host' - C:\WINDOWS\system32\mshta.exe "%1" %* , and check your version of this file... Perhaps your sys administrators made a booboo with a custom IE7 rollout.
Alternatively download from http://www.iecustomizer.com/?url=IE7TBTweaks_Download.asp
and test this working IE7 HTA application.. (Please note the license is for Personal non-Commercial use), so you have to uninstall it from your company computer after testing.
Another thing to test is if this error occurs when running IE7 in no-Addons mode or with third-party browser extensions (Advanced tab of Internet Options) disabled.
Regards.