*************************************************************
Windows for Workgroups Network Function Sampler
(c) 1995 by Trigeminal Software, Ltd.

June 12, 1995

Michael S. Kaplan (CIS 102140, 1533)
Trigeminal Software, Ltd.

*************************************************************

This file contains all of the warnings and disclaimers, as well
as a little info on the functions.

For a little history and other info, see "ABOUT.TXT"
*************************************************************

LICENSE:

You have an unlimited, royalty-free right to use these functions in
your own applications, with the following conditions:

1) If you use the functions without make substantive changes to them,
you should leave intact the copyright notice in the declaration
section and at the head of each function.  You may (if you choose) 
delete any of the comments provided about the function.

2) If you do incorportate the functions into your own applications or
make substantive changes to them, you are under no obligation to
leave the copyright notices on the functions.  I would prefer that you
give me credit (if not on paper or in your code, than at least in your
heart), for whatever inspiration you received.  I say this for my own 
sake, the sake of my company, and the sake of my Gateway 2000 that 
spends most of its waking hours fearing the site of me, since I have
been crashing it from 20-50 times a day for quite some time now, between
this and several pther projects we have running.

3) If you do use the functions, you will make a good faith effort to let
me know how they worked out.  While I not providing an official warranty
of these functions (see below for details), I do pledge that I will make
every effort to help when these functions cause more problems than they
solve.

*********************************************************************
WARNINGS:

These functions are made for Windows for Workgroups version 3.11. 
I haven't tried most of them on any other type of OS.  Some of 
the networking functions require the WFWNET.DRV to be the primary 
network driver, although I have been able to get most of them to 
work with the IBM network driver supplied with the Rumba/400 package 
(the OEM version of Wall Data's fine product).  Most of the functions 
are exported from USER.EXE (the underdocumented half) rather than the 
driver, which is why the majority of them SHOULD work regardless of 
the network used. I'd love to hear from you with any information about 
what worked and didn't work in your environment, so I can make sure it 
will the next time.

I cannot, however, make any guarantees.  I lost count of how many
times I crashed my my network driver, the Network DDE library, my 
copy of Access, and Windows while making sure these functions would work
correctly and consistently.  I cannot promise that they won't make
your computer stand up and dance around.  (Actually, I can promise
that, but you get the idea).  You are on your own when you use them
(especially if you try to change them around).  I can promise that 
they have gone through quite extensive testing for safety and have not
(to my knowledge) ever done any damage that a reboot and a database
rebuild wouldn't cure.

Quick Notes on each of the sample screens (to see how the functions are 
called, just look at the code behind the form, the module, or both).  
The file manager button is included on the sample forms that affect disk 
shares so that you can see if they have been connected. (If you leave 
the file manager open while you are experimenting with these functions, 
don't forget to use the file manager's "Refresh" command to insure you 
are seeing the current results.

COMMON NETWORK DIALOGS:

Browse Disk (Print) Shares:  Will let you browse the current network PCs 
and their disk (or print) shares, choosing one of them.  This function 
DOES NOT connect to the resource; it simply returns the path of the 
chosen share if it is successful.  Look at the manual network functions 
to make connections with these paths after they have been retrieved.

Connect to a Disk (Print) Share:  Lets user connect to the chosen disk 
(print) share -- specifying which drive letter to assign, etc.  This 
function DOES connect the resource if it is successful.

Disconnect from a Disk (Print) Share:  Lets the user disconnect from a 
chosen disk (print) resource.  This function DOES disconnect the chosen 
resource if it is successful.

Disk (Print) Share Connection:  With the network driver I used, this 
function acted identically to the "Connect a Disk Share" (although it 
used a different API call).  THIS MAY NOT BE THE CASE WITH OTHER DRIVERS. 
Both functions are exported from USER.EXE, so different drivers may give
different support for these functions.

Create/Edit a Disk Share:  You can specify in the blue box the directory 
that you would like the box to use as its default value (if you don't 
choose one, it will be left blank).  This function DOES create the chosen 
share if it successful.  I was unable to consistently use this function 
to create print shares, with GPFs occurring about 20-30% of the time.

Delete and Existing Disk Share:  This function will let you delete an 
existing disk share.  This function DOES delete the chosen share if it 
successful.  I was unable to consistently use this function to create 
print shares, with GPFs occurring about most of the time.


MANUAL NETWORK CONNECTIONS:

Please note that for the demo forms, only limited error trapping has been 
used.  All of the return constants are listed in basNetwork, and all error 
values on the network functions are sent to a global "last error" variable.  
This value can be called by using the GetLastError() function provided.  
NONE of the values are checked, so you will not know why a function failed.  
If you use any of these functions, you will probably want to use at least 
some of the constants to help your users out; otherwise, they won't know why 
the function did not succeed.

Get User Name:  This function returns the currently logged-in user's name.  
Although this function usually will work (even when there are multiple 
networks), there is better function that will perform this task under a 
wider range of circumstances available for download.  See the comments in 
the function for details.

Get Connection:  If you type in a local name (such as T: or Y:), this 
function will return the full network path that it is connected to.

Cancel Connection:  If you type in the local name (such as T: or Y:), this 
function will cancel the connection.

Add Connection:  If you type in the full network path (in the form of 
\\PC\ShareName), the password, and the local name to use (such as T: or Y:), 
this function will make the connection.  

PROGRAM MANAGER UTILITIES SAMPLER:

This function will allow you to create a group or icon (or delete a group 
or icon) from either your computer or anyone else's on the network.  Simply 
leave the PC Name blank for the local PC.  The functions will only work if 
you type in all of the values.

Network DDE shares for program manager must be established before these 
functions will work.  A simple function in the "miscellaneous" section will 
copy a network share in one SYSTEM.INI file to another SYSTEM.INI file.  By 
using an automated combination of the functions NetworkDriveConnect(), 
NetDDEShareCopy(), and NetworkDriveDisconnect(), I was able to add DDE 
shares for program manager, MS Word, MS Access, and MS Excel, without 
leaving my PC.  See the section on this function below for more details.

Note: The create icon function actually allow much more freedom of choice 
than this example would suggest; you are able to specify a path for the icon 
and a working directory as well.  Several other functions such as HotKeys and 
whether to run minimized are available with only minor changes to the function.


MISCELLANEOUS FUNCTIONS:

These are a few miscellaneous functions that I have found useful at times.  

Sample "About..." Box:  This is more of a sample of retrieving different system 
values than anything else.  

Built-In toolbars:  This toolbar disabler is an easy way to get rid of built-in 
toolbars -- this is especially useful if you provide applications for both the 
runtime and the regular Access environments.

Execute an Application:  This function is much more useful than the generic 
"shell" function provided by Access.  I had thought this function was a great 
idea of my own, but I recently saw a procedure with virtually identical 
functionality in Chris St. Valentine's ACCESS POWER PROGRAMMING.  

Copying a DDE Share:  I should warn you that this function does not represent 
good Windows programming technique in that it blatantly ignores Microsoft's 
warnings not to directly edit Net DDE shares in SYSTEM.INI.  After playing 
with the NDDEAPI.DLL functions from Access for a day or so, I got tired of 
crashing Access and decided to cheat a little.  This function will copy the 
share information on one computer to another, as long as you supply the paths 
for SYSTEM.INI on each.  It is actually a wrapper for two other functions -- 
NetDDEShareGet() and NetDDEShareGet(), which are actually just wrapper functions 
for the common GetPrivateProfileString, WritePrivateProfileString functions that 
will edit INI files.  Of course, the passwords and other details will be the
same, but I don't know many people who use a WFW network for security, so I don't
find this to be too much of a problem.  

I do not know if this function will work on Windows NT, as I am not sure where 
in the registry Net DDE shares are stored, and whether these functions (which 
do not use the Network DDE API) will be translated properly.  If they work in 
NT they will probably work in Windows 95.  I am still working hard on Network 
DDE from Access; I think that Network DDE is one of the most useful and least 
exploited connectivity functions available, and I will defend that statement 
until Network OLE is released.


June 12, 1995

Michael S. Kaplan (CIS 102140,1533)
for Trigeminal Software, Ltd.

