Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

November 21, 2008 12:00 AM

Happy Holiday HTA

Send an HTA greeting card this holiday season
Windows IT Pro
InstantDoc ID #100488
Rating: (1)
Downloads
100488.zip

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

Related Content:

ARTICLE TOOLS

Comments
  • Emy
    4 years ago
    Dec 12, 2008

    Cute. ?

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.