-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|526|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
svrman
Created : 31 May 2007
Edited : 31 May 2007

.hta files

Easiest way to make an app?

So basically as I've been crawling through several forum archives, I stumble upon this relatively unknown and little talked about file format.

Now I did say archives so this has been around for a while, don't get me wrong but it's pretty new to me
So for those who still have no clue as to what exactly a .hta file is, this is for you.

It's basically a html file as an stand alone application.

An app where you can strip the borders, menus, disable context menu (right click menu), set your own icon and start minimised/maximised/windowed.
You even set it to either show in taskbar when minimised or not - giving you the ability to hide the app upon launch... sneaky

And because the app is basically a html file, it benefits from being able to be customised with CSS, run javascripts and connect to the internet.

However, this is only possible because the hta is a file running off the IE browser engine and thus is only available on the windows platform. The hta file is also dependent on the IE browser version currently on the enduser's system.

I'll admit I haven't read too much into it and not sure what version of windows are compatible.

Fun

So how do you make a hta file?

Simplest. way. ever. You rename the file extension. Wow. I wish they did that for all apps lol.

ex. index.html -> index.hta

Here's something you could try, save this bit as index.hta (I promise there's no malicious code here )



if you want to view in the browser, rename the hta to html.

Well anyway you could alway use it for presentation stuff and over bloat it with Ajax scripts.

Reference on .hta can be found here.

 

Comments


Thursday, 31 May 2007, 02:50
Jayenkai
I don't get it..

Other than the ability to hide the fact that it's a webpage, what other use is there?
I mean, when you can just as easily "run" a html file, and then let the OS's settings decide what it runs on, then why not just do that?
Thursday, 31 May 2007, 05:13
svrman
I think the purpose is that it hides the fact that it's a webpage - you can use the browser engine without needing to display the browser.

I was actually thinking about Steam - Valve's content delivery system as it works to that effect. In fact, If I'm not mistaken I think it does use the IE engine.

Well anyway it's just one of those things you go "Oh, cool. Nice to know" and then never speak of it again
Thursday, 31 May 2007, 06:14
TheMadProff
Urm, i dunno why, but the program killed my computer, as it kept coming up with errors
Thursday, 31 May 2007, 07:00
svrman
Hmm It shouldn't but I'd expect it's your version of IE. Upgrade to 7 and all should be good.
Thursday, 31 May 2007, 07:21
JL235
I thought there were already far more common ways to hide browser stuff on a web page.

I got loads of script problems too, and I'm running the latest IE 7 on Vista! What's really scary though, is how on Vista the right-click options off the task-bar are disabled. Making it slightly harder to close.
Thursday, 31 May 2007, 07:47
svrman
Well that's interesting. Perhaps MS have removed support for it in vista? I can understand if they did because the .hta isn't subjected to the same security protocols as a html through the IE browser.

Anyway the code I posted was just demonstrating ways you could use the DOM in the app.
I've just reposted - it's all you need to get a .hta to work.


|edit| Set border="normal" to enable the min/max/close buttons |edit|
Thursday, 31 May 2007, 13:04
HoboBen
That's awesome! I never knew about these!

Calculator program:

Thursday, 31 May 2007, 13:11
mike_g
Hey, thats quite cool.
Thursday, 31 May 2007, 17:01
HoboBen
Jayenkai I mean, when you can just as easily "run" a html file, and then let the OS's settings decide what it runs on, then why not just do that?



Because then I can do pretty things like this!

Anyone who may want it, use and edit freely.
Sunday, 03 June 2007, 13:00
garand
WOW this is neat!
Sunday, 03 June 2007, 13:42
JL235
I think I'd still rather just make a normal application, and I believe many GUI's support using html in their code.

That is quite cool, but the fact anyone can then edit it is still a bit of a down side.
Sunday, 03 June 2007, 19:43
garand
ahh. yes your are right diablo....
Sunday, 03 June 2007, 20:00
HoboBen
I dunno, on the otherhand that's kind of an upside. If I don't like a HTA program (for example, if they use a stupid font), I could tweak it to make it better. Or, I could tinker with it and learn from it.

And, it's less expensive than Visual Basic

The fact that you can use both JavaScript and VisualBasic Script, plus the elegant simplicity of HTML and CSS, and additionally not have to worry about different browsers beyond Internet Explorer version 5 to 7 is all pretty positive too.