tags:

views:

106

answers:

3

I recenty stumbled upon some files described as "HTML Applications" on my Win XP machine.

  • What are they?
  • Who would ever use them? Why do I have like 2 or 3 of them on my PC?
  • How do they generally work? I mean hey - HTML is for adding formatting to text - HTML Applications? What the? Microsoft?
A: 

Are you using Chrome?

Yassin
No, but why do you answer me with a question?
sub
Chrome has nothing to do with HTAs!
slugster
I think Yassin thought of HTML applications as HTML files because he/she has no clue.
sub
@sub: Chrome allows you to pin any webpage as an application, check "Create application shortcuts" menu (http://goo.gl/cQRZ). However, in spite of not answering your question, you should be more polite with people that spend their time trying to do it.@slugster: Yes, Chrome has nothing to do with HTAs, but it also has "applications" stuff.
Yassin
Yassin, StackOverflow is not a forum. If you need clarification about the original question, you would ask that in a comment. If you're not sure what the OP wants, you shouldn't try to answer. Instead you lost rep points, because not only is it not an answer, it shows that you know even less about the topic than the OP. I'm not trying to be impolite, just explaining to you how SO is intended to work.
Todd
+3  A: 

See here for Introduction to HTML Applications (HTAs).

Alex K.
+1  A: 

HTAs are good for things like VB scripts that you want an interface for other than MsgBox or a console window.

Since it's HTML, you can use buttons, text areas, check boxes, etc to show information to the user and get input from them, and use CSS to style it all. Since HTAs run on the local machine, you have access to everything you can do with VBScript for computation and file access, WMI for system management, program automation with COM objects, data access with ADO, and so on.

I once wrote an HTA that installs, updates, and compares Word templates on a user's machine from a common folder. The user can see their template folder next to the common folder to know if they are up to date, and hit the Update button if not.

Another one manages and verifies the installation of a program on a user's computer, copying over the exe if necessary, making sure registry entries are set correctly, putting a shortcut on the desktop, letting the user test and see the results of the installation, and so on. It also logs all of this info to a common place for me to check on.

One of my biggest HTA projects was a Project Manager system. The interface showed me all of the Excel, Word or Access projects I had going on. It would open the selected project in its particular environment, and showed me all of the pieces of it. It allowed me to import and export code modules from a common library using VBE automation (the Visual Basic Editor COM interface).

I'm about to put one together to show current and "dead" printer drivers on a user's machine. With me coaching them over the phone, they will run the HTA which will list all of the installed printers. They will put a check mark next to the ones they want to keep, then hit a button to delete all of the others. Fairly easy for them, and saves me from going to each and every PC to fix this.

Many of these kinds of things only make sense in a Windows environment, but you can write some pretty general purpose stuff with it too. Anything you can express in VBScript or JScript (JavaScript) and want an HTML/CSS front on is a good candidate for an HTA. I also even wrote a basic network chat system in it at one point.

There are lots of little HTAs around for converting data from one format to another, say converting comma separated data to columnar, or adding or removing various kinds of formatting like quote-printable escape codes, converting hex formatted text into plain text, and on and on. Copy text into one input text area, check a few options and press the Go button, then copy the converted data from the output text area. One I wrote was an SQL formatter. It would take SQL code and wrap it up as either a VB or Delphi string, and also go from wrapped back to plain SQL code, with basic indenting and "pretty printing" to clean it up.

I don't do as much with HTAs as I used to, but still think they are a pretty cool technology for the kinds of jobs that fit in that niche.

Todd