Stdemo Player 1.3 Copyright (c) 1992,1993 Mik Kvitchko ----------------------------- | Mikhail Kvitchko | | 361-A Crowells Road, | | Highland Park, NJ 08904 | | USA | | mik@bhsw.com | ----------------------------- This package consists of the following files: HIST.TXT - History of changes README.TXT - This File SCRIPT.TXT - Stdemo Player example script STDEMO.DIZ - Stdemo Player short description. STDEMO.EXE - Stdemo Player program STHOOK.DLL - Stdemo Player DLL What is this? ============= Stdemo Player is the application that you can use to create demos, tutorials or manually prepare scripts to "play" them into any Windows application. It allows you to write a script, which will start one or several Windows application, perform a series of keystrokes or mouse actions aimed to demonstrate the application or to perform some pre- defined sequence of actions. While your script is being "played", you can disable completely keyboard and mouse, so that user will not be able to interfere with the running demo and to cause a conflict. At certain points of you script you may interrupt it in order to interact with user. These interactions allow: - to show the "text" box with some explanatory text before script will continue ( this is the main idea of how demos and tutorials are to be designed); - to show the "menu" box where user can select one of several choices, and therefore control the script's execution; - to show the "input" box, where user can answer questions and enter some text, which later can be used in script. There are many varieties of these boxes in order to make your demo flexible, and they can be forced to be shown in some convenient places on the screen. Moreover, user can move them across the screen to be able to see different parts of the covered windows. Even if you are not interested in preparing demos, you may find Stdemo Player useful. For example, you can replace your complete Startup Group to the single Stdemo Player script which will launch all your "startup" applications, and even perform some initial actions for every of them: set up default options, load files, etc. How to play the script? ====================== When you run stdemo.exe without parameters, it looks for the file "script.txt" in the current working directory, and if it is there - "plays" it. Also you may pass the name of the script as a parameter to stdemo.exe. This name may include the full path. How to write a script? ====================== Script is a plain ASCII text file. It may include: - keystrokes; - commands; - interaction breaks; - comments. Every keystroke, command or interaction break is a unit. Stdemo Player reads units from the script one by one and executes them. After one unit is executed, Stdemo Player waits for some time (time-out tick, which can be set or changed at any point in the script) and then executes the next unit. Time-out doesn't affect the interaction breaks (which are "text", "menu" and "input" dialog boxes). Once one of this boxes is shown - only user may continue or stop script execution, selecting "Continue" or "Stop" button on the box. Comments are ignored, as you may expect, and cause no time-out delays. 1. Keystrokes. -------------- Any text in the script which is not a command, interaction break or comment is a set of keystrokes, i.e. every symbol of the text causes a keystroke to be sent into the current window application (see below). There are also several special symbols which allow to simulate different keyboard keys. Any keystroke can be preceded by one or more special symbols ("@" - Alt, "#" - Shift or/and "%" - Control) as you see in the following example: @A Alt-A #A Shift-A %A Ctrl-A #%A Shift-Ctrl-A There are also many special keys which are coded by "escaping" them with the "]". They are follows: ]| Down ]^ Up ]< Left ]> Right ]~ Tab ]! Return ]- PgUp ]+ PgDn ]\ Backspace ]Z Esc ]I Ins ]D Del ]H Home ]E End ]0 F10 ]1 F1 ........... ]9 F9 ]] ] ]@ @ ]% % ]# # ]: : ]$ $ This is not a full set of the keyboard keys, as you may note - but it covers most of usable ones (I hope). 2. Commands. ------------ All commands start from the colon sign ":". Some of the commands must be coded as a separate line in a script, others can be mixed with the keystrokes. The rule of a thumb is: if a command has fixed format or ends with the special separator - it can be placed anywhere, otherwise it has to be coded as a separate line of the script. The general format of a command is: : is a single letter or some other symbol; may vary; one parameter can be a letter, text or number; parameters follow the code without blank, and in some cases are separated one from another by the special separator "|". The commands are: :=x set time-out tick to x milliseconds. Default time-out is 1 millisecond. Example: :=1000 set time-out tick to 1 sec. :T skip 1 time-out tick. Example: abc:T:T:Tefg enter "abc", then wait for three current time-out ticks, then enter "efg". :Dtext change current directory to "text". Example: :Dc:\windows\system : 3.1 TEXT interaction break. +++++++++++++++++++++++++++ Every TEXT box has a single text field which fills the dominant area of the box. The header line is: :#sxy parameter "s" defines the size and must be a letter: S - small, M - medium, L - large, W - wide, N - narrow; parameter x defines the position along the x-axis: L - left adjusted, C - centered, R - right adjusted; parameter y defines the position along the y-axis: U - up adjusted, C - centered, D - down adjusted. The body of this break consists from the text only, which will be shown in the single text field of the box. Text may be coded as one or more lines in the script, but it'll be placed continuously in the box, applying word wrap. There are two special commands which can be entered into the body of the TEXT box: .N causes the following text start from a new line in a box; .S causes to skip one line and continue to fill a box with the following text. The delimiter line is: # Example: :#NCC This is the narrow box, centered on the screen. .S This text starts after the empty line. .N This text starts from the beginning of the new line. # Notes: 1. The amount of text you can place into the text box depends on the current display mode ( VGA, SVGA, etc. ) and fonts supported by your current display driver. This creates a problem: the text you placed into the box might not fit when you run your demo on a different system. In order to make sure, that it will not happen, Stdemo Player checks if the whole text fits into the box, and if not - it is trying to reduce the font size, until the whole text fits. If the system doesn't have a small enough font - the scroll bar will be added to the text field, so that user can read the whole text by scrolling it. 3.2 MENU interaction break. +++++++++++++++++++++++++++ Every MENU box has a header text field on a top and from 2 to 9 menu item fields ( radio buttons). The header line is: :*sxy parameter "s" defines the size and must be a letter: S - small, M - medium, L - large; parameter x defines the position along the x-axis: L - left adjusted, C - centered, R - right adjusted; parameter y defines the position along the y-axis: U - up adjusted, C - centered, D - down adjusted. The body of this break consists from the text which will fill the header text field of the menu box, and two or more menu lines. Text may be coded as one or more lines anywhere in the body; it'll be placed continuously in the header field, using word wrap if appropriate. Text line should not start from a digit. Every menu item line has the following format: nlabel|item text "n" is a menu item field number (1..9); "label" - is a label in the script where control will be passed if this item will be selected from the menu box. "item text" is a text to fill the menu item field. The delimiter line is: * Notes: 1. The "small" menu box has 2 menu fields, the "medium" - 5 fields, and the large - 9 fields. 2. If there is no text for the header - the header field will not be shown in the box. 3. If there is no lines for some menu items - the correspondent item field will not be shown in the box. Example: :*MCU Select one of the three: 1l1|This is the first item 3l2|This is the second item 5l3|This is the third item * :Ll1 :#SCC You've selected the first. # :Gcont :Ll2 :#SCC You've selected the second. # :Gcont :Ll3 :#SCC You've selected the third. # :Lcont 3.3 INPUT interaction break. ++++++++++++++++++++++++++++ Every INPUT box has a header text field on a top of the box and from 1 to 9 edit fields. The small box has only one edit field, the medium has 5, and the large has 9. Every edit field in the medium and large INPUT boxes has the correspondent description field on a left of the every edit field. The header line is: :%sxy parameter "s" defines the size and must be a letter: S - small, M - medium, L - large; parameter x defines the position along the x-axis: L - left adjusted, C - centered, R - right adjusted; parameter y defines the position along the y-axis: U - up adjusted, C - centered, D - down adjusted. The body of this break consists from the text which will fill the header text field of the menu box, and one or more input lines. Text may be coded as one or more lines anywhere in the body; it'll be placed continuously in the header field, using word wrap if appropriate. Text line should not start from a digit. Every input line has the following format: nDescription_Text "n" is a input field number (1..9); the correspondent input field will be filled with the current value of the variable $n. If the variable is empty - the field will also be empty. "Description_Text" is a text to fill the description field for the "n"- th input field. The delimiter line is: % Notes: 1. The "small" input box has 1 edit field, the "medium" - 5 fields, and the large - 9 fields. 2. If there is no text for the header - the header field will not be shown in the box. 3. If there is no line for some edit field - the correspondent edit and description fields will not be shown in the box. 4. After user entered some text in the input field - this text will be assigned to the correspondent variable ($1..$9). Example: :(notepad.exe|1 :$2John :%MCU Please correct your name. 2Your first name: 4Your last name: % Hello, $2 $4! :#SRD Is my greeting correct? # :) 4. Comments. ------------ Any line in the script outside the interaction breaks, which starts from "//" is being treated as a comment. Future. ======= I'm sure you noticed that the program can be further extended ( for example, auto recorder would not do any harm ). Please, share your ideas with me, if you are interested. Acknowledgments. ================ 1. Thanks to CompuServe and all participants of the WinSdk forum - you were my teachers, when I started programming Windows. 2. Thanks to Brent Rector, whose book "Developing Windows 3 Applications" (and once he personally) helped me along my way of learning Windows. 3. Thanks to my employers and friends Ken Winston and Michael Markov; their enthusiasm kept me busy enough to grow. Legal Stuff. ============ Stdemo Player is shareware. If you like Stdemo Player, a registration fee of $20 - $30 would be appreciated. I think, it is a fair price. But if you think that the price is too low or too high - send me whatever amount you find appropriate. When you register, I can replace irrelevant "MIK" icon on all dialog boxes to another one (you may send your icon to me) and will send the updated copy to you. Provided that your cash will cover at least diskettes, time and postal expenses. If you support my efforts, I can even customize Stdemo Player according to your needs. Please, send check or money order to: Mikhail Kvitchko 361-A Crowells Road, Highland Park, NJ 08904 USA Comments? Questions? Suggestions? I will be glad if you contact me at: Internet: mik@bhsw.com CompuServe: Mik Kvitchko [71250,1660] (checked irregularly). You may make copies of this program and give them to others as long as all files are included and unaltered. Disclaimer. =========== I've taken great care to ensure the program performs as stated. Still, I cannot guarantee this will be the case on every system. As such, you agree NOT to hold me responsible for ANY damages directly or indirectly related to the use of Stdemo Player. The author of this software is not responsible for any damage due to use of this program. This software is provided without warrantee of any kind. A Personal Note... ================== I write C better than English. Please excuse my mistakes and funny constructions in the above text, if you noted some (I'm sure, you did!). Especially articles... They are incomprehensible! Thanks!