NDW 3.0 Time - Version 1.20 by Ken Schneider Copyright (c) 1994 Symantec Corporation NDW3TIME is a sample of Symantec ScriptMaker, the new scripting language in Norton Desktop for Windows, version 3.0. This archive should contain the following files: NDW3TIME.SM - Fully commented ScriptMaker file NDW3TIME.EXE - Compiled version of NDW3TIME.SM CUCKOO.WAV - Sample sound for hourly chime NDW3TIME.TXT - This file To prevent this program from getting lonely, please put all the above files in your Norton Desktop directory (C:\NDW by default). What does it do? ---------------- The program (NDW3TIME.EXE) will place up to four indicators on the Title Bar (also called the Banner) of the Norton Desktop. You may choose to add: the current date, the current time, available system resources, and free Windows memory. These indicators are positioned such that the memory and resources are to the left of the title, and the date and time are to the right. Additionally, you can select a .WAV sound to play on the hour if you wish. An example: 10,000 Kb 82% - Norton Desktop - Jan 31, 1994 12:00 AM This display will refresh every second and has negligible impact on system performance. As stated before, you may add any or all of these indicators in any combination to the Title Bar. All of the program's options (except Title Text) are kept in the NDW.INI file under the section [NDW3TIME], which is created the first time the program is executed. A sample configuration would look like this: [NDW3TIME] Date=1 (Display the Date or not) Time=1 (Display the Time or not) Res=1 (Display Resources or not) Mem=1 (Display Available Memory or not) Quiet=1 (Display dialog or not) Chime=C:\NDW\CUCKOO.WAV (Sound to play on the hour) This information is mantained in the script by the commands ReadINI and WriteINI and need not be changed manually. Changes made to the text of the Title Bar from the main dialog are reflected in the NDW.INI file just as if you had changed the Title Text in NDW's new Control Center under Desktop Layout (see *Note). This is maintained under the following section: [CONFIGURATION] BannerTitle=Norton Desktop Other than the display and sound options, there is the ability to have the program run hidden (without the dialog box) after it has been configured the first time. To enable this function, check the box "No Dialog at Startup" in the main dialog. This would be the desired setting if you wish to run the program from your Start-Up (or Auto-Start) group, or from the load= line. With this setting, running the program a second time will bring up the dialog again where you could change the configuration or unload the program. * Note: If you have "Save Configuration on exit" set in NDW's Control Center (under "Defaults"), changes to the Title Bar made by NDW3TIME will be over-written by the original value when NDW saves it's configuration. To make the change permanent, change the caption through Control Center under Desktop Layout. Or, you can turn off Save Configuration on Exit, which has the added effect of speeding up your exit from Windows. As a programming sample: ------------------------ The included .SM file shows how this program works. The script is over 400 lines (fully commented) and illustrates the use of over 50 ScriptMaker commands, as well as calls to external (to ScriptMaker) functions, such as MessageBeep, which makes system sounds that Windows associates with different icons in dialog boxes. While there are other ways to perform some of the functions in this program, the main purpose is as an example of many of the commands within ScriptMaker. You will find embedded Functions, Arrays, For...Next loops, If...Then and Select Case statements, Dialog Boxes, Message Boxes, and more. I hope you will take the time to see how this program was created and are able to use these examples in your own scripts. Disclaimers and Caveats: ------------------------ * This program works properly on all the computers it was tested on, but it may not work on yours. * This program is free for you to use and copy in any fashion you feel appropriate, with the exeption of putting your name on it and selling it to someone. Enjoy and share! If you do copy this or give it to someone, do them a favor: please include all the four files you found here in this archive. * If you want to use this program, use the EXE version. It has been pruned of all comments, spaces and blank lines to make execution faster and leave a smaller footprint in memory. If you run the SM file, it will work, but won't be able to unload itself properly and may leave multiple copies in memory. * Although I am an employee of Symantec and as such this program is the intellectual property of (and Copyright (c) 1994) Symantec Corporation, it is intended only as a programming sample and is not supported by their Technical Support Department. One last thing: I'd like to thank Ted Sadler and David Braverman for their help. Gentlemen, my hat is off to you, if in fact I was wearing one. Ken Schneider February 15, 1994