---------------------------------------------------------------------------
                               Z3DC.DRV
---------------------------------------------------------------------------
                      3D Controls Driver for Windows
                                  V1.27
                          (c)Pekic Zoltan, 1994.
---------------------------------------------------------------------------

1. Purpose
   
   Z3DC.DRV is a Windows installable driver that uses Microsoft's CTL3DV2.DLL
or CTL3D.DLL libraries to provide great looking 3D controls for all dialog 
boxes in Windows.

2. How does it work?

   Windows installable drivers are basically DLL libraries, with an extra 
callback function (DriverProc) which responds to a number of DRV_XXX messages 
sent by the system to the driver. Z3DC's code could have been implemented in 
an ordinary DLL file, but Windows offers a simple and consistent way for 
installing, configuring and removing of DRVs through Control Panel Drivers 
application.
   Z3DC installs a WH_CBT hook in response to the DRV_ENABLE message, using 
the SetWindowsHookEx API function. The hook procedure (CBTProc) responds to 
the following messages:
HCBT_CREATEWND ... First, the task that creates this window is being estabili-
                   shed (GetWindowTask). If this isn't the first time the task 
                   has come up, or there are no more free entries (max. 31) in 
                   Z3List array no further actions are taken (it's already re-
                   gistered or rejected). If it is, an instance of CTL3DV2 or
                   CTL3D is loaded, and Z3List is filled with necessary data.
                   The list of modules that should not be registered is scan-
                   ned. If there is no match, the application instance that 
                   creates the window is registered (CTL3DREGISTER) and auto-
                   matically subclassed (CTL3DAUTOSUBCLASS) with the current 
                   instance of 3D library. If there is an opened setup dialog 
                   box, it is notified (PostMessage) with an user defined 
                   WM_ADDLB message. The Z3List array index is added to the 
                   window as a new propery called (how original!) "Z3DC".   
HCBT_ACTIVATE  ... This message is received after HCBT_CREATEWND. If the shell
                   app has been determined (hWndShell != NULL), but not sub-
                   classed yet (OldShellWndProc == NULL), then the old window's
                   proc address is saved and set to a procedure inside Z3DC.DRV
                   (NewShellWndProc). 
HCBT_DESTROYWND .. The "Z3DC" property is looked for. If found, it means this is
                   the first window created by an application instance, and it
                   is unregistered from 3D library (CTL3DUNREGISTER) using the
                   data retrieved from Z3List array. "Z3DC" propery is removed,
                   and the library is freed.
 
3. Installation

   Automatic ..... Use the Drivers app in Control Panel. Click "Add..." ->
                   Select "Unlisted or updated driver" -> Browse or enter 
                   the directory with OEMSETUP.INF and Z3DC.DRV files. 
                   After a few more OKs and restarting, enjoy Windows' fancy
                   new look!
                   NOTE: Z3DC.DRV won't install if there is no CTL3D.DLL or 
                         CTL3DV2.DLL on your machine!

   Manual ........ Copy Z3DC.DRV to \WINDOWS\SYSTEM directory.
                   Open the SYSTEM.INI file:
                   - Append z3dc.drv to drivers entry in [boot] section
                   - Append the Z3DC=z3dc.drv entry to [drivers] section
                   Save SYSTEM.INI and restart Windows.
   
4. Deinstallation

   Automatic ..... Use the Drivers app in Control Panel. Select "3D Controls 
                   Driver" in the list box, then click "Remove".
   Manual ........ Remove Z3DC.DRV from \WINDOWS\SYSTEM directory.
                   Modify the SYSTEM.INI file:
                   - [boot]     section .. remove z3dc.drv from drivers entry
                   - [drivers]  section .. remove the Z3DC=z3dc.drv entry
                   - [z3dc.drv] section .. delete it completely

5. Problems ?

   Z3DC.DRV works fine with almost all apps running under Windows 3.1, WfW 
3.11 or Win-OS/2 (2.1) sessions: otherwise you will see the much-hated white 
popup window informing you that a GPF has occured in CTL3DV2.DLL (or CTL3D.DLL). 
Such apps can be prevented from being automatically registered with Microsoft's 
3D libraries by using the "Setup..." option in Control Panel Drivers applica-
tion. In it's upper part, the setup dialog box displays which 3D library is 
being used, and all the running modules (their main windows) currently regis-
tered with it. In the lower part, you can specify the names (usually equals 
the name of the executable file, without the extension) of up to 32 modules 
which should not be registered with the 3D control libraries. My advice is to 
include all apps that use 3DCTL*.DLL by default (e.g. Microsoft Office) or 
Borland's BWCC.DLL (will work, but Z3DC can't make them any prettier). You can 
also enable a warning beep when a starting module is being rejected. Clicking 
the "About..." button will bring up a dialog box with some not very useful 
information. Don't be alarmed if some dialogs look less than perfect (text
background white, not gray) - Z3DC is not responsible for that. 

6. File List

   Z3DC.ZIP should contain the following files:

   Z3DC.TXT       This file
   Z3DC.DRV       3D Controls Driver
   OEMSETUP.INF   Needed for automatic installation
   Z3DC.C         Source code
   Z3DC.RES       Resource file
   Z3DC.DEF       Module definition file

7. Compiling and Linking

   Z3DC was developed with Borland C++ 4.0, using the following options: Pas-
cal calling convention, large memory model, SS never equals DS, Windows DLL 
explicit functions exported, case sensitive link/exports/imports, 80286 code, 
no floating point. I hope you will have no problems rebuilding it with other 
C/C++ compilers, in case you want to change something.

8. Changes since V1.15 (first public release)

-   Z3DC now provides a convenient feature when exiting Windows: you can choose
whether to return to DOS, start a new session or reboot the computer. This is 
achieved by the subclassing the Windows shell (e.g. PROGMAN.EXE). The new shell
procedure (NewShellWndProc) responds only to WM_CLOSE message with shift keys 
up (otherwise simply calls the original window procedure). A small dialog box is
created where you can select where to land after this session (ExitWindows API 
function) and see the time elapsed since it's start (GetTickCount). This feature
can be disabled in the "Setup" dialog box. (Note: Z3DC does not react to HP's
DASHBOARD as Windows' shell - no WM_CLOSE message ???).

-   A "Disable driver now" check box has been added to "Setup" dialog box. All 
apps started while Z3DC.DRV in disabled state will retain their normal look.


IMPORTANT NOTE:

  You may freely use, distribute and enhance the Z3DC's code but please don't
  forget to mention the original author's name. Thanks!

                                              Pekic Zoltan
                                            Rijeka - Croatia
                                         zoltanp@rijeka.riteh.hr 


--------------------------- End of Z3DC.TXT -------------------------------
