Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  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 log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
CES 2009: Ballmer Announces Windows 7, Windows Live, Live Search Milestones

During his first-ever Consumer Electronics Show (CES) 2009 keynote address last night in Las Vegas, Microsoft CEO Steve Ballmer announced the pending public availability of a feature-complete Windows 7, the final version of Windows Live Essentials, and ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

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 Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

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 Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


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 Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing