--------------------------------
TVideoSplash 1.0
Released August 4, 1995 (8/4/95)
--------------------------------

	I have written TVideoSplash because I was not satisfied with the splash
screen solutions I have been able to find.  TVideoSplash allows you to
EASILY add a splash screen to your program with minimal code changes.  This
new version adds upon the old TSplash's functionality by adding support
for MCI animations (like AVI files).  It is now also possible to display one
of multiple bitmaps chosen at random each time the screen is shown.

---------------------------------
Adding TVideoSplash to your program
---------------------------------

- Add the tsplash.rc file to your app's resources.  The splash screen and
  splash bitmap are defined in tsplash.rc.

- Add a "static SPLASHINFO sinfo;" to the top of your TApplication object's
  source file (i.e. so it is a global variable).

- Fill in the SPLASHINFO structure.  See "SPLASHINFO" section below.

- Add "TVideoSplash* splash;" to the private section of your TApplication
  object.

- Add the following code to your InitMainWindow() function:

(at the very top)

	 if(sinfo.style & Splash::HideMainWindow)
		nCmdShow = SW_HIDE;
	 else
	 if (nCmdShow != SW_HIDE)
		  nCmdShow = (nCmdShow != SW_SHOWMINNOACTIVE) ? SW_SHOWNORMAL : nCmdShow;
. . .

(after MainWindow is created)
	splash = new TVideoSplash(&sinfo);
	splash->Create();
. . .

  This code initiates the splash screen and shows it.  TVideoSplash centers
  itself on the screen by default.

- Add "LRESULT DeleteSplashDlg(WPARAM wParam, LPARAM);" to your app's
  protected section and add "EV_MESSAGE(WM_DELETESPLASHDLG,DeleteSplashDlg),"
  to your app's response table.
		TVideoSplash will post WM_DELETESPLASHDLG (#defined as WM_USER + 1) to
  your app when it is closed by default.  Your app will then know it is OK
  to delete the splash dialog (and free up the memory it uses).
		If you want to display the splash dialog again, just "new" a new
  TVideoSplash and Create() it.

--------------------
SPLASHINFO structure
--------------------
typedef struct tagSPLASHINFO {
	Splash::Style	style;
	int				timeOut;
	char far* 		title;
	char far* 		info;
	int				numBitmaps;
	int   			baseId;
	char far* 		vidFilename;
} SPLASHINFO;

	Member			Description
----------------------------------------------------------------------------
	Splash::Style	Holds the style bits that define TVideoSplash's behavior
						This is made up of Splash::Style's or'd together.

	timeOut			If Splash::Bmp is specified, timeOut is the number of
						milliseconds the splash screen will stay up.  If
						Splash::Video is specified, timeOut is the number of
						times the video will be played before the splash screen
						is closed.

	title				Text to fill the first static text element with.

	info				Text to fill the second static text element with.

	numBitmaps		The number of bitmaps TVideoSplash has to choose from
						when picking bitmaps displayed at random. See below.

	baseId			The resource id of the first splash bitmap.  See below.

	vidFilename		The name of the video file to be played in the splash
						window.

Comments:  Fill in this structure first thing in OwlMain().  If you have
			  some sort of problem doing it in OwlMain(), just make sure that
			  it is done before InitMainWindow().

----------------------------------
How to use the RandomBitmaps style
----------------------------------

	First of all, collect all the bitmaps that you would like to display as
splash bitmaps (size does not matter).  Add them all the the tsplash.rc
file through Resource Workshop.  Make the first one's ID IDB_SPLASHBITMAP
(go ahead and remove the finskin2.bmp from the tsplash.rc file).  Make the
next one's ID (IDB_SPLASHBITMAP value) + 1, and the next's
(IDB_SPLASHBITMAP value) + 2, and so on. . . .  That's all you need to do
to the RC file.
	Now, fill in the numBitmaps field in SPLASHINFO with the number of
bitmaps you added to the RC file.  Next, 'or' Splash::RandomBitmaps
into the style field of SPLASHINFO.
	The random number generator doesn't do a good job of picking bitmaps to
display if there is less than four or five of them.  With less than four
bitmaps, the generator will pick the same one about 7 times in a row before
it picks a different one.


---------------------------------------
Changes to TSplash/TVideoSplash code
---------------------------------------

= TSplash to TVideoSplash =

- Added the ability to play MCI animations in your splash screen.

- Put all enum's into their own class (Splash).

- Dialog now correctly sizes itself according to the size of the bitmap or
  video it is displaying.

- Put all info TVideoSplash needs into the SPLASHINFO structure defined in
  splash.h.

- The text in the two static text controls is now dynamically set according
  to the info in the SPLASHINFO structure.

- Enum Splash::RandomBitmaps added to randomly display a bitmap from the
  available bitmaps.  See explanation.

- Enum Splash::CheckDisplayColors added so you can display a different bitmap
  depending on the number of colors available.

= 1.5 to 1.6 =

- Added SplashStyle enum to eliminate the use of booleans.  Pass the wanted
  SplashStyle styles to your TApplication in its constructor. (See the
  example code)

- Added TSplash::HideMainWindow style.  With this style enabled your
  MainWindow will be hidden until TSplash closes.  This style was added
  to try and make TSplash work like the splash dialogs found in WordPerfect
  and Ami Pro (and many other commercial programs).

- Figured out that the constructor should be passed a NULL parent when it
  is created inside InitMainWindow().  This is because MainWindow has not
  been Create()'d yet, and the HWindow is invalid.  It only causes an error
  in the debug version of Windows, but we still want the best product
  possible.  This problem was identified by Niklaus Mohni - thanks Niklaus
  for this and the timer suggestions!

- Added TimeOut parameter to the constructor and SetTimeOut() function to
  further ease coding.  Calling SetTimeOut(-1) will make TVideoSplash skip
  installing the system timer so it will stay up like a normal dialog box.

= 1.0 to 1.5 =

- Added the WM_DELETESPLASHDLG message to free up the memory used by TSplash

- Fixed a few memory leaks present in the TSplash code

- Added ability to reuse the splash dialog after its initial display.  To do
  so, pass false as the second parameter of the TSplash constructor.

	TSplash( GetMainWindow(), false );

->Thanks to Greg Bullock (cis 75322,202) for all WM_DELETESPLASHDLG
->related code and the memory leak fixes!


---------------------------------
Things that you might want to try
---------------------------------

	The day before I released this code I finally picked up the AutoDesk
Animation player from the AutoDesk Multimedia forum.  I can't get FLC's
to play correctly - the animation's upper-left corner is centered in the
VideoControl's window.  I tried to use the MCI_PUT command with MCI_OVLY_RECT
and stuff like that, but nothing worked.  If anyone can figure this out,
let me know!

	The random number generator that I use to pick the random bitmaps does
not work well at all.  It works even worse when you call randomize(), which
makes no sense because you're supposed to do that before calling random().
If anyone can think of a solution, let me know!


------------------------
Getting in touch with me
------------------------

	If for any reason you need to talk to me (bug reports, additions,
suggestions, whatever . . .) just drop me a line.  I frequent the BCPPWIN
and WINSDK forums on Compuserve.  My CIS is 75627,3615.  Don't hesitate to
send me questions or bug fixes, I am here to help!

	Russell Morris
	CIS: 75627,3615
	Internet: 75627,3615@compuserve.com

