HTA's

H

Herb Stull

Hello All,

A response I received from a recent post suggested that I develop an HTA to
enable my ASP.NET application to run in full screen mode in the user's
browser.

I've played with this a bit and am having no luck getting it to work. Can
anyone point me to sample code that would open my login.aspx form using an
HTA?

Also, from what I've seen of the HTA it always displays a prompt to the user
to Open or Save. Is there any way to avoid this?

Thanks for any help.

Herb
 
B

Brian K. Williams

Herb,

Just use a simple JavaScript to open it in full screen.

function fullScreen(theURL)
{
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}

Regards,
Brian K. Williams
 
H

Herb Stull

Hey Brian,

Thanks for the tip but my experience with window.open is that it leaves
the original window behind (open) and you have to do a window.close to
get rid of it.

The window.close then throws a prompt to the screen asking the user if
they want to close. This tends to throw them off and we get a lot of
calls asking if they really want to close.

You know how end users are, they'll call 3 or 4 times before they
finally get the hang of things and I have over 700 folks using this app.

Any other suggestions would be appreciated.

Herb
 
H

Herb Stull

Hey Homer, that's okay. I didn't know what it was until a week or so
ago.

It's an HTML application. It's hard to find information about it so I'm
hard pressed to tell you where to look other than in the Visual
Studio.Net docs.
 
B

Brian K. Williams

Yes, I had this problem also.. You wont get rid of that prompt even with a
HTA. This is a built in security feature of IE, you are only able to modify
the properties of a window that you generated with script.

What I did to get around this was set the size of the window to 100px with
window.opener and moved it way off screen to about -9000px top. When your
window that you opened is closed just set the top and width back to the
original size and position.

You might be able to simulate the F11 key with JavaScrit onload. I haven't
tried that yet.

If you ever find a way to-do this other than above, please email me.

Thanks,
-Brian
 
E

Eric Lawrence [MSFT]

Also, from what I've seen of the HTA it always displays a prompt to the
user
to Open or Save. Is there any way to avoid this?

For security reasons, no. The idea would be that the HTA is something they
download and run from their local computer.

Why do you want this application to run full-screen?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

Eric Lawrence [MSFT]

What I did to get around this was set the size of the window to 100px with
window.opener and moved it way off screen to about -9000px top. When your
window that you opened is closed just set the top and width back to the
original size and position.

I don't believe this technique will continue to work in WindowsXP SP2.
You might be able to simulate the F11 key with JavaScrit onload. I haven't
tried that yet.

I don't think this will work.

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

Eric Lawrence [MSFT]

If you have full control of the client computers (e.g. this is a tool for
your company on their intranet) you could trivially write a VB6 program
which runs fullscreen and displays your custom web app inside a full-screen
Web Browser control.

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Brian K. Williams

I don't believe this technique will continue to work in WindowsXP SP2.

I am running WindowsXP Pro SP2 on my server at home. If you want to see it
in action open this link.
http://www.inetzombies.com:8008/QuasiWindows/

(disclamer) I wrote this site well over four years ago just for fun as an
experiment, so everything is not working.
:~)
I don't think this will work.
Yes, I am sure this wont work. After a little investigation the F11 eventKey
is not accessible.

-Brian
 
M

Muckeypuck

I think there is a way around it. gamespy or gamearcade or one of those host
a game for you sites uses the hta model. they launch their content from an
icon on the users desktop . I think that these could be brilliant for an
intranet when combined with net <objects>. but if the people who know how
to do this wrote tutorials on it, they couldn't sell their components for
200 bucks a pop while they write tutorials for us all day =)
 
B

Brian K. Williams

That's a great idea. It doesn't sound that difficult.
Because they are launching the window from a desktop link the security
constraints don't apply.

-Brian K. Williams
 
M

Muckeypuck

Ha i knew it!

The Web Model
The Web deployment model consists of an application that can be run and
administered just like a Web page. In this scenario, the HTA is launched
simply by browsing to its URL or by accessing it from the Internet Explorer
Favorites list. Before launch, an Internet Explorer dialog box presents the
user with the choice to open or save the application. After launch,
ancillary application components are downloaded from the server as needed
and then cached. Servers must have the MIME type "application:hta"
registered for delivery through the http: protocol to work.

This model boasts some important strengths. It facilitates seamless updates:
The intranet administrator need only post the new code or content for the
client to receive the latest version. It provides ease of use: The user need
never install or uninstall the application. Unused applications are
automatically flushed from the cache. One important consideration when
evaluating this deployment model is that server-based applications cannot be
run offline or when the server goes down. One option is to anticipate this
eventuality by implementing the advanced channel (CDF) features in Internet
Explorer 4.0 and later. For more information, see the Introduction to Active
Channel Technology.

The Package Model
In the package deployment model, the installation process for the HTA is the
same as for traditional applications. Files are copied from disk or over a
network, using any installer or self-extracting executable. The installer
places the application in the Program Files directory or in the directory
selected by the user. A link to the HTA is included in the Start menu. And
the application's dependency on Internet Explorer 5 or greater is
registered. This way the user is warned that uninstalling Internet Explorer
will disable that application. Look to tools vendors for vehicles for
packaging and delivering HTAs to your specifications.

Like the Web model, the package model has points in its favor. The user is
prompted only during the initial installation about trusting the
application; thereafter, the application runs as trusted code just as an
..exe does. Also, the installed HTA is always available to users, whether
they are connected to the server or not.

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp
 
M

Muckeypuck

yea, ive been meaning to find something to pick apart so i can learn it. you
could do alot of cool stuff. and use an xcopy deployment model too!
 
R

Ram

Brian,

Closing the current window without propmpt should not be a problem.
Check the following code.

<html>
<head>
<script language="javascript">
function closeMe()
{
window.open("http://www.yahoo.com", '', "fullscreen=yes");
window.opener=self;
self.close();
}
</script>
</head>
<body>
<form>
<input type=button onclick="closeMe();" value="Open new window in full
screen and close this window">
</form>
</body>
</html>

Let me know if this helps.

--Ram
 
H

Herb Stull

Hello Eric,

Thanks for all of your comments and suggestions. We want this ASP.NET
app to look just like a Windows app in the browser. Sans the menu bar,
icon bar, and anything else that gives the impression of a browser. This
is the primary issue and it can only be accomplished now by using a
window.open, which opens a new window with the desired attributes.

The first problem is with pop-up stoppers. Many users these days are
running them and it zaps out new window leaving the user confused.

The second problem lies in the window that remains behind. If you issue
a window.close, the user receives a prompt asking if they want the
window to be closed. This also tends to confuse them.

The full-screen issue is secondary, but also desired, in that the app
looks and reacts better in this mode.

I guess my question would be, why is this such a difficult goal to
accomplish?

Thanks again for your help and guidance. It is very much appreciated.

Herb
 
B

Brian K. Williams

Ram,

Maybe I didn't explain it quite so well in the previous message.
Let's say you are www.intel.com and a user browses to your site. The user
had opened the browser from the Windows menu item, Internet Explorer. This
browser was not spawned by your code on intel.com via window.open or any
other scripting method. If you attempt to close it with the self.close() the
user will get that annoying popup warning. (Built-In MS Security)
On the other hand, if the user navigates to intel.com and you open another
window via window.open() you have full control of this window.

The use of an HTA was mentioned as an alternative. This will give you
complete control over the window, but the annoying message will now move to
the opening of your site not the closing. When you open a HTA Application
the user will get a popup window asking them if they want to save or run it.
I am not sure if this can be removed, if anyone finds a way to-do it..
please forward me the info.

Thanks
-Brian K. Williams
 
E

Eric Lawrence [MSFT]

I am not sure if this can be removed, if anyone finds a way to-do it..
please forward me the info.

No, this cannot be removed (without making a really dangerous change to the
client's registry), and if it could be, someone needs to notify Microsoft
Security. ;-)

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top