========
LANegram
========

Version 3.0, October 2009


LANegram is a replacement for the deprecated Windows Messenger Service
and associated NET SEND command.  For some time now Microsoft has
recommended the use of MSG to send messages within a LAN.  The MSG
utility is part of the Terminal Services suite (which includes the
Remote Desktop Sharing subset).  However editions of Windows such as
Windows Vista Home do not include these utilities and services.

Both home and small businesses are likely to have networks of PCs
running Vista Home.  They also require some form of intranet messaging
from time to time.

LANegram may help fill this need.


System Requirements
===================

Any system on Windows 2000 or later should be able to run the
LANegram utilities.

Around 3.6MB of memory is occupied by LANegram while it runs, so
systems with less than 512MB may not be the best candidates.  Disk
requirements are modest.


Package
=======

LANegram is supplied with precompiled binaries in the form of a
Windows Installer package.

The LANegram package consists of two programs:

    o LANegram.exe User program that receives and displays alerts.

    o Send.exe     Command line user program that sends alerts.


Installation
============

Double-click the LANegram.msi package.  This will install the
programs *per machine* (not *per user*) placing a shortcut to
LANegram.exe into the All Users' Startup folder.

This shortcut may be modified to add a command line parameter:

    /NOEXIT

That switch hides the "Exit" option on the LANegram tray icon's popup
menu.  While LANegram is in "restored" state Ctrl-X can be entered to
exit the program if required.  This can prevent users from casually
exiting the LANegram utility but still allow it to be closed for
administrative purposes through this less obvious mechanism.

If desired you can also create a shortcut for running Send.exe, which
causes it to open a console window so you can enter alert commands.

You can also run msiexec explicitly to set the Startup shortcut's
arguments at the time of installation, as in:

    msiexec /i LANegram.msi STARTARGS="/noexit"


General Use: LANegram.exe
=========================

Client machines would each run a copy of LANegram.exe upon logon via
logon scripts, Startup folder, or other standard approaches.

    o On starting LANegram.exe will minimize to the system tray.

    o When a message arrives a tray balloon will pop up showing the
      latest alert and the count of current alerts.  They tray icon's
      tooltip will show the count of accumulated alerts and the
      "channel" in use (if not left at the default).

    o The user may double-click the tray icon, or right-click and
      choose Restore to restore the LANegram window.

    o The LANegram window presents a list of accumulated alert
      messages.  Each message can be clicked to dismiss it from the
      list.

      You can also use keyboard "arrows" to move up and down through
      the list and press the space bar or Delete key to dismiss the
      selected item.

    o When all messages have been cleared or the user clicks the
      minimize or close botton LANegram will once more minimize to
      the tray.

    o Users can also use the tray icon popup menu and select
      Clear Alerts.

    o If /NOEXIT has not been used to start LANegram the tray icon's
      popup menu will show an Exit option that will close the program.
      When the LANegram window is in restored state pressing Ctrl-X
      will always close the program.

    o Users can temporarily suppress popup balloon notifications if
      desired.  This setting is not retained between runs.

    o When a new message is accepted and 100 are already being held
      the oldest is discarded.


General Use: Send.exe
=====================

Administrators or others may send messages by running Send.exe from a
command line.  Send.exe can also be run by double-clicking its icon,
which opens a console window and accepts send requests.

More details are described in the Command Line section below.


Command Line: LANegram.exe
==========================

LANegram.exe accepts two optional switches:

    o /C <channel> Specifies a channel other than the default 0.

    o /NOEXIT      Hides the Exit option in the tray icon's popup
                   menu.

Normally the default channel "0" is used.  By specifying an
alternative channel two (or more) copies of LANegram can be running.

Channels should be short alphanumeric values without blank spaces,
though in general file naming rules apply to channel IDs.  Embedded
hyphens or underscores should be fine.

The LANegram tray icon tooltip will identify any use of non-default
channel settings.

These switches can be specified via the shortcut used to run the
program.


Command Line: Send.exe
======================

Send.exe accepts command lines of the form:

    SEND [/? | [/C <channel>] <name> <message>]

This means you can use:

    /?           Brief help
    /C <channel> Send via optional alternate "channel" instead of
                 the default channel 0.
    <name>       Optionally wildcarded "name" to send to, either an
                 exact computer name or user name in the primary
                 domain/workgroup or a pattern for computer and user
                 names to send to.
    <message>    Message text.

Channel and name values may not have embedded spaces.  They are not
case sensitive.

    Examples:

    send * File server BLUE going down in 10 minutes

        Sends the message to all users in the domain or workgroup of
        the sending machine.

    send ge* Database server MARLIN is back online

        Sends the message to users George and Gerry as well as
        computers Geryon and Gina.

    send /c 1 marlin Is the server about ready?

        Sends via channel "1" to the user and/or computer named
        "marlin".

    send *lab?? All test lab servers going down in 5 minutes

        Sends to all computers and users matching the pattern, for
        example ProgLab01, NetLab-A, and LabXY.

    send Lab[A-C,F-H] 10 minutes to complete your work

        Sends to laba, labb, labc, labf, labg, and labh.

    send Fred Lunch in 10 minutes?

        Sends to the computer and/or user named Fred.

Name patterns follow the rules for VB6 "Like" operator patterns.

If there are no command line parameters at all, Send.exe prompts the
user for one or more commands.  These take the same form, without
the leading program name of course.

Entering an empty line ends the program.


Caveats
=======

There are a few things to be aware of when considering the use of
LANegram:

    o LANegram messages are sent via Windows Networking over TCP/IP,
      NetBEUI, or whatever underlying protocol is used.  This means
      the computers must have Windows Networking ("File and Print
      Sharing") enabled and allowed in through the any software
      firewalls.

    o Transmission is via LAN broadcasts, so LANegram messages will
      not travel over the Internet.  In some cases these will not
      traverse in-house routers either.  Most home and small office
      Internet gateway routers are front-ended by switches that
      readily pass this traffic though.


Legal
=====

LANegram is offered free for use by anyone for any purpose without
guarantees or any implied offer of support or acceptance of liability.
Use this software at your own discretion.

It is offered AS-IS.

The source is supplied and may be used to enhance the product or can
be used in whole or in part as the basis for other programs.


Recompiling LANegram
====================

The programs are written in Microsoft Visual Basic 6.0 and to
recompile them requires VB6 Professional or Enterprise Edition.  No
third party components or TLBs are required.

LANegram.exe can be compiled conventionally.

Send.exe must first be compiled and then relinked for the Console
Subsystem.  This can be accomplished by dragging the EXE and dropping
it on the supplied LinkConsole.vbs WSH script.  This script uses a
hard-coded path to LINK.EXE that may need to be updated before using
the script.

Testing in the IDE is not possible as written.  However you could add
a check for running in the IDE and call AllocConsole/FreeConsole to
make it possible.
