Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


December 2008

Happy Holiday HTA

Send an HTA greeting card this holiday season
RSS
Subscribe to Windows IT Pro | See More Scripting Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

Once in a while it’s fun to do something a little different with scripting. For example, I created a HTML Application (HTA) that’s a greeting card for the holiday season. HolidayTree.hta uses basic timers with randomized colors to produce a colorful holiday tree with blinking multicolored lights and a Happy Holidays greeting (see Figure 1). You can find HolidayTree.hta in the 100488.zip file by clicking the Download the Code Here button, above. To “open” the card, simply double-click the HolidayTree.hta file.

If desired, you can easily personalize the greeting and change the color of the tree lights and the background. To change the greeting, open the file in Notepad and find the code

 <p align="center"><b>
  <font size="7" color="#800000">
  <span style="font-family: Brush
  Script MT"> Happy Holidays</span>
  </font></b></p>

Replace Happy Holidays with your greeting.

To change the color of the tree lights or background, you need hexadecimal color codes. I included the AddColor.hta in the 100488.zip file for this purpose. In the Add- Color.hta’s UI, click the Rainbow Chart button to create a red-green-blue (RGB) color chart in Microsoft Word. This chart consists of 180 different colored cells. Inside each cell is the RGB value that creates the color. After you find the color you want, you can convert the RGB number into the hex code in AddColor.hta. (If you’d like more information about AddColor.hta, see the VIP exclusive article “Add a Little Color to Your World” at windowsitpro.com/article/articleid/47800/add-a-little-color-to-your-world.html.)

After you have the hex codes for the colors you want to use, plug your hex color codes into HolidayTree.hta. The code

 <body bgcolor="#008080">

sets the background color. The code

 str = "#FF0000,#FFFF00,#FF00FF," & _
  "#00FF00,#00FFFF,#0000FF,#ADFF2F"
  str = str &
  ",#FF8C00,#FF1493,#FFCC00," & _
  "#FFEFD5,#8B008B"

sets the color of the tree lights. Happy holidays to you all!

—Jim Turner, domain administrator and applications developer, Computer Sciences Corp.

See associated figure

End of Article



Reader Comments
Cute. ?

bigubax December 12, 2008 (Article Rating: )


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Microsoft Announces Office 2010 Technical Preview

Microsoft on Monday unveiled the first major milestone of its upcoming Office family of products. Dubbed the Office 2010 Technical Preview, this prerelease version of Office includes Office 2010 Professional and Visio 2010. Other Office 2010 ...

How can I stop and start services from the command line?

...

Where is Microsoft NetMeeting in Windows XP?

...


Related Articles Creating Context-Sensitive Help Screens for Your HTAs

HTA F/X

Use an HTA as a UI for Your VBScript Scripts

Hooked on HTAs

Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events WinConnections and Microsoft® Exchange Connections

Check out our list of Free Email Newsletters!

Scripting eBooks Keeping Your Business Safe from Attack: Encryption and Certificate Services

Best Practices for Managing Linux and UNIX Servers

Building an Effective Reporting System

Related Scripting Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format

Test Drive IT Solutions and Get Free Music Downloads
Solve your toughest IT problems with these free downloads and receive 5 free music downloads!


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement | Reprints and Licensing