# VBForums UtilityBank > UtilityBank - Utilities >  Utility: LANegram - NET SEND Replacement [VB6]

## dilettante

This project should be useful as a utility and also as a source of sample code for using Mailslots in VB6 programs.  The Mailslot.ctl in this Project should prove usuable for most simple applications of Mailslots in VB6.  Just copy Mailslot.ctl and Mailslot.ctx to your Project folder and then use _Add file..._ to add the control.

Full source is provided here.

Precompiled binary files were scanned with AVG Free 8.5 and should prove virus-free.  They may currently be downloaded as LANegram.msi (1.3MB).  _See updated version below before downloading this one._  Size limitations prevent the installer from being attached here.


*Description*
Right or wrong, the Windows Messenger Service was victimized as being vulnerable to "messenger spam."  I suspect that users and the press confused the Windows Messenger Service with IM applications such as MSN Messenger and Windows Messenger.  In any case the Messenger Service is gone starting with Vista and disabled under later Windows XP Service Packs.

People have been advised to use the MSG utility instead of NET SEND in order to send alerts within intranets.  This can be problematic since MSG is part of Terminal Services (and its subset Remote Desktop) which is not present in all editions of Windows and may even be disabled on versions and editions of Windows that have it.

Nonetheless many people relied on using NET SEND for putting out different kinds of administrative alerts, and they need an alternative.  Home and small business users trying to use Vista or Windows 7 Home editions in particular are left with no out of box solution.  LANegram is one attempt at a replacement for NET SEND and the Messenger Service.


*Features*
Command line Send.exe for sending broadcast or directed messages to users on the LAN.Tray application LANegram.exe monitors and displays incoming alerts.Supports alternate channels for subgroup messaging.Incoming alerts produce a tray popup balloon.Individual users can temporarily suppress balloons if engaged in a task this might disturb.Double-clicking the tray icon brings up a window displaying a list of recently received alerts./NOEXIT switch can be used to suppress the Exit menu choice from the tray icon's menu.LANegram can still be exited via "End Process" or Ctrl-X while the GUI window has focus.Precompiled binary supplied as a Windows Installer package.

*Author*
Bob Riemersma


*System Requirements*
The enclosed precompiled binary uses Microsoft-built VB6 SP6 merge modules for its dependencies.  It should run properly on all supported versions of Windows: Windows 2000 and later.  Tested on XP SP3, Vista SP2, and Windows 7 RC.


*License*
Unencumbered public domain freeware.  May be used by anyone in whole or in part in either source or binary forms.  No guarantees or support offered.  LANegram is made available as-is for use at your own discretion.

A serious attempt has been made to debug the LANegram package but errors may still exist.

----------


## dilettante

Suggestions from early feedback prompted me to take another look at LANegram.  In particular there is a need for a simple interface that just pops up a message box instead of having the elaborate tray icon, balloons, and alert log.

The following changes have been made:
New /SIMPLE switch that can be used to select the alternate user interface.PATH environment variable updated by the Installer package, making it easier to use Send from a command prompt.Reworked the readme file, now provided in .RTF instead of .TXT format.
The precompiled package is at LANegram 3-1.msi at the present time.  It installs a copy of the readme to the program directory.

I have attached a new source code package here as well.  I hope no new bugs have been introduced.

----------


## xpinvader

how to send one sample message?

----------


## dilettante

Once the application is installed sending messages is much like using NET SEND.  For example you can open a command prompt and type:

send * Hello World


I'll add that you can navigate to the LANegram folder in Program Files using Windows Explorer, then either double-click on Send.exe or right-click and choose Create Shortcut (or Send to|Desktop) and use this shortcut.  This will bring up a command window where you can enter one or more Send commands.

----------


## dilettante

Almost two years later this remains a popular small utility.  Since Windows 7 was even more popular than Vista the XP-exodus continues to ramp up.

Please remember that LANegram requires Windows 2000 or later, Win9x is not supported.


Here is a new version 3.2 that contains only small changes.  It should be fully compatible with 3.1 so a mixed network should work fine, allowing incremental deployment of the update.  Because of the relative insignificance of the update there is no compelling reason to move from 3.1 to 3.2 and you can take your time.

*Changes:*
Minor changes to a few tooltip messages./SIMPLE UI "Ok" button changed to "Cancel" and only activated via mouse click or Escape keystroke.
The second change is the important one.  Some users reported a problem where work typing in another window caused a popup dialog arrival to be dismissed by those other keystrokes.  Changing Ok to a Cancel means mouseless users can still interact with the dialog without frequently dismissing the LANegram dialog inadvertantly as often.


The prebuilt MSI package can be downloaded from LANegram 3-2.msi at this time.

The full source code is attached here as a ZIP archive.

*Note:*

Some people must not use many Installer packages, because I was asked why MSIEXEC continues to run after the installation completes.  This is normal, as described in Microsoft's support forums:

MSIEXEC Process Remains in Memory



> The Windows Installer service (msiexec) stays running for 10 minutes after performing any installation activity.  This is designed to be a performance enhancement in case multiple MSIs are installed sequentially.  It should not stay running for more than 10 minutes under normal circumstances though unless installation activities are still happening on the system.  You should be able to see descriptions of installation activities by going to the application event log on your system and looking for events with the source name MsiInstaller.

----------


## dilettante

Oops!

I should have mentioned that to install 3.2 you must uninstall 3.1 first.  Product/patch code management was not handled in these MSI packages, so running the 3.2 MSI where 3.1 is already installed just produces an uninstall/repair session, which won't help you.

The 3.2 MSI uses a red banner with LANegram icons in it, so if you are seeing the blue-gray and shoreline banners you are not installing the updated 3.2 version.  I hope that helps.

_Corrected!

The reposted 3.2 MSI has a unique ProductCode and the same UpgradeCode, so Installer will properly replace 3.1 by 3.2 if you use this one and already have 3.1 installed._

----------


## dilettante

Ok here we go again:  Version 3.2.0.1

Small improvements to the Cancel button handling of 3.2, and hopefully will install over 3.1 without issues.  When in doubt uninstall the old then install the new.

Source attached, .MSI package at LANegram3-2a.msi

----------


## kgraafei

A few of my users are getting Error 62, "Input past end of file" when launching LANegram.exe.  They are all on Windows 7, HP workstations.  It works fine for all other users with the same setup.  It is working fine on all my XP and XP x64 machines.

Have uninstalled/reinstalled; updated to latest version; tried to run it in compatiblitiy mode; restarted; etc.  It always gives the same error.

Any help on this matter would be greatly appreciated.

Thanks for a reliable and easy replacement to NET SEND.

Sincerely,

Kevin

----------


## dilettante

Hmm.

Sounds like a corrupted settings file.  I'm not sure how else this error can occur.  The file should be at:

C:\Users\_user name_\AppData\Roaming\BVO Computing Services\LANegram Messenger\0.dat

One detour might be to simply delete the file and let the progam create a new one.


I'm wondering if the problem is related to putting this into the roaming profile.  The settings involve screen coordinates and different PCs may well have different monitor dimensions.  It may also be related to High DPI settings on your HP machines.

Still, I'm not sure why this I/O error would occur.  Can you post the contents of this file from a machine/user where the problem occurs?


I can see several small tweaks that might help and of course some error trapping/recovery could help too.  Seeing a settings file first might save several go-rounds trying to "fix" the wrong problem though.

----------


## kgraafei

Deleting the file worked.  Thank You!  Most of those 0.dat files were empty.  I don't use roaming profiles, however I use a profile wizard to migrate setups.  Maybe that is the root of the problem.  Let me know if you need any more information to further debug.

Thanks Again,

Kevin

----------


## dilettante

One thing I find laughable is the number of "magic uninstaller" vendors peddling their wares to "help you uninstall LANegram."

In most cases any uninstall problem stems from trying to uninstall it while you have a copy of it running!  Simply shut it down, or if you're desperate use Task Manager to kill it.  No big deal.

If you really want to get rid of the few tiny files it creates under Users' profiles see post #9 above.

It's pretty much that simple.

Softpedia gives it a "100% clean" award.

----------


## R.U.Wasted

I have a question. When the program gets to 100 messages, it stops showing new messages. I there a way I can have the newest message delete the oldest message, maybe after 50 messages?

Thanks!

----------


## dilettante

> I have a question. When the program gets to 100 messages, it stops showing new messages. I there a way I can have the newest message delete the oldest message, maybe after 50 messages?


This confused me at first because new messages past 100 were intended to delete the oldest and then add the new 100th entry.

It turns out this was a bug I missed in testing that nobody has ever brought up before.


*New version, 3.3:*

So this bug (which only impacts "standard UI" users and not "simple UI" users) has been corrected.

In addition a more visible change reversed the order of the listed messages in the standard interface.  These used to run top to bottom, newest at the bottom and the oldest at the top.

Now the newest message is listed at the top, "pushing" the older ones down.  And once the 101st comes in the oldest gets deleted before the new 100th entry is added (at the top).  I hope this makes more sense for most people.

The readme.rtf file has been updated to reflect these changes.  This appears at the end, in the change history.

This version will work fine in a network where other machines are using an earlier version, so you can gradually update machines if you choose.


*Caution:*

As several people have commented before, even though these Installer packagers were authored to allow a new version install to replace an older one, there are some sequencing problems I have not had time to work on.  The result is that you can end up with multiple entries in Add/Remove Programs and some general confusion if you try to revert a newer version to an older one by uninstalling the new one.

So... I recommend that if you have an older version already installed you first remove (uninstall) the old LANegram, and then install the new one.


*Downloads*

MSI (binary installer) package is at LANegram 3-3.msi

Source attached below.


I hope this works.  When you get away from a project it can take time to get your head back where it was so you rebuild everything correctly and especially get the repackaging right.  I spent some time testing the new version and it seems fine.  I verified the "upgrade" issue still exists.

I'm also hoping most people won't have a problem with the messages listing in newest-first order too.

----------


## R.U.Wasted

Thanks for your help!

----------


## dilettante

P.S.

I would try moving this to another site, since most of the users never need the source code anyway.  But there are a ton of links out there now pointing here and I'd risk breaking them.

I still might do so though, with an entry here pointing to the new location after it happens.

----------


## Tweaky

Are you able to send to multiple users? if so what would the syntax be

----------


## dilettante

The syntax is much like that of NET SEND.

You can send to all using * or to all similar names like George and Gerry using ge* but it doesn't accept a list of names.

----------


## MayaTekla

Hi dilettante,

We have been using this in our school for some time now for admin notices, I wonder if you would mind us altering the source a little to better suit our needs, though mostly the look and feel of the popups? Along the same lines, any chance of converting the project files so we can open them in VB2010? We dont unfortuantely have VB2008 or so in our MS agreement  :Frown:

----------


## dilettante

The source code is available here so you can do anything you like with it.  See the first post above for license information.  There are no usage restrictions at all.


Sorry, I don't have a VB.Net version of this.  It was written in VB6 in order to keep its footprint small.  A VB.Net version would be pretty big with CLR & Framework deployment requirements as well.

VB6 is part of VS 6.0, and the most practical way to acquire that is through an MSDN subscription today.

----------


## Snow02

I signed up to say thanks for this. It's just what I was looking for.

----------


## dilettante

You're welcome.

----------


## gsaldana71

I successfully installed vb6 on a windows 7 and xp machine and it works both ways but I get two alerts whenever I send a message. This happens on both machines. Is this normal or there a fix?

----------


## dilettante

I suspect you have two networks.  Even with one physical LAN you may have more than one if you are using TCP/IP along with NetBEUI or IPX.

There isn't any fix for this in the current product.  A workaround isn't planned.

----------


## gsaldana71

IT may be that you are right. I have both my ethernet port and wireless running. Thanks!

----------


## dethbones

Just found this awesome little program and it is almost everything ive been looking for.  one question though...can i send a message to a group of computers or a group of users?  I'm in an AD environment and would like to send messages to a AD group.  thanks again for such a cool little program

----------


## dilettante

No, it doesn't handle AD groups.

It is possible to use a computer name or a user name as the destination, or use wildcards/patterns to send to "groups" in a looser sense, e.g.:

send bzc* text

Sends "text" to all users and computers with names starting with "bzc" and then anything else.

send *bzc text

Sends to all that _end with_ "bzc" with anything else before that.

More complex patterns can also be used, but there is nothing that can reference AD group membership.

----------


## dethbones

that still might work for me b/c my computer naming convention is similar on all computers...ill do some testing

thanks again!

----------


## dilettante

For reference, the way it works is that _Send.exe_ always broadcasts each message.  The "smarts" are at the receiver (_LANegram.exe_) end.

The destination pattern is sent as part of the message.  LANegram takes a received message and does a *Like* comparison between the sent pattern (after converting it to lower case) and each of the simple ComputerName (w/o the Domain) and simple UserName (after converting it to lower case).  If either matches the LANegram considers this a message to "him."

The full description of these *Like* patterns can be found in Like Operator.


So a relatively complex "destination" example might be: *[BWZ]*

This would mean "any computer name or user name that has a 'B' or 'W' or 'Z' anywhere in it."

Since these are treated as case-insensitice by lowercasing them this example has identical results: *[bwz]*


Another example might be: ??ABC?##*

This means "two of any character, then 'ABC' followed by any single character and two numeric digits, followed by nothing or anything."


Or even: [!G-Z]*

Which means "one character not in 'G' though 'Z' followed by nothing or anything."

----------


## dethbones

well it seems to be working pretty well until i started testing across different vlans...it seems if all the computers are on one vlan it works as it's supposed to but different vlan no message pops up at all.  is this correct behavior?

example:
say my computer ip is 192.168.31.xx and i send a message to abc* all computers on 192.168.31.xx get the message pop up BUT computers using 192.168.32.xx, 192.168.30.xx, or any other vlan no pop up

thanks for such quick responses!

----------


## dilettante

Well I can't take a lot of credit for quick responses, I just happen to be looking in here lately!

Crossing VLANs depends entirely on how they are connected by switching and routing.  The issue is that we're using Mailslot broadcasts.  As far as I recall for NetBT these use:

UDP 138, NETBIOS-DGM, NetBIOS datagram service

Unless such broadcasts are allowed to pass unhindered you can't use LANegeam between your VLANs.  Network admins often have legitimate reasons for blocking these (poorly behaved applications may generate excessive chatter) and part of the reason for VLAN and similar technologies is to isolate such traffic anyway.

In "modern" AD domains the domain servers get around this by filtering traffic and passing things to each other via TCP connections.  LANegram has no way to piggyback on this though, and would need to have its own "broadcast relay servers" on each VLAN, and of course they'd need to be configured to know about each other.

I can't recall how the old NET SEND and Messenger Service dealt with this in later Windows versions.  Perhaps those messages just "fell on the floor" as well?

----------


## Naza

Thanks for this awesome program! it is a lifesaver!

I have just tried it out on Windows 8 and at first it worked OK but after installing a few apps I started to get this error?

Run-Time error "62":

Input past end of file


Anyone seen this? Does this mean some VB6 runtime DLL has gotten overwritten ? If so what DLL's should I be looking for and where?

----------


## dilettante

> I have just tried it out on Windows 8 and at first it worked OK but after installing a few apps I started to get this error?
> 
> Run-Time error "62":
> 
> Input past end of file


Sorry I didn't see this earlier.  Even sorrier I don't have a fix since I haven't been able to find a reason why that error might occur.  All I can think of might be a settings file corruption problem.

See post #9 above.

This could occur if you have had roaming profile problems within your network.

----------


## dilettante

There seems to be a problem with the file hosting of the binary installer packages.  I am looking into this.

_Update:_

Problem resolved, at least for now.  :Wink:

----------


## nico@nfbio

Hi,

I could really use this application. I installed the .msi package on a test machine and my machine. Both are in the same domain/ip segment with firewall turned off. My send machine has Windows 8 and the receiver has Windows 7. I can't trace the problem. 

What could be wrong?

----------


## dilettante

No idea, except that perhaps there are software filewalls blocking File and Printer Sharing on one or both machines?

Also, some Ethernet switches will not relay the broadcasts used.

----------


## taff123

> Well I can't take a lot of credit for quick responses, I just happen to be looking in here lately!
> 
> Crossing VLANs depends entirely on how they are connected by switching and routing.  The issue is that we're using Mailslot broadcasts.  As far as I recall for NetBT these use:
> 
> UDP 138, NETBIOS-DGM, NetBIOS datagram service
> 
> Unless such broadcasts are allowed to pass unhindered you can't use LANegeam between your VLANs.  Network admins often have legitimate reasons for blocking these (poorly behaved applications may generate excessive chatter) and part of the reason for VLAN and similar technologies is to isolate such traffic anyway.
> 
> In "modern" AD domains the domain servers get around this by filtering traffic and passing things to each other via TCP connections.  LANegram has no way to piggyback on this though, and would need to have its own "broadcast relay servers" on each VLAN, and of course they'd need to be configured to know about each other.
> ...



I am trying to configure our environment to get LANegram to send across different VLANs - is the application able to use multicast?

----------


## dilettante

No, I haven't found any way to make that work.  It would require quite a rewrite and some code for handling multicast UDP, and there is no standard library for that for VB6 programs.

As far as I can tell a Windows Server that relays Mailslot broadcasts among your VLANs would solve this.  Domain Controllers _should_ do that but often people don't connect them directly to every VLAN.

You may have to look for another alternative.

----------


## couttsj

> Suggestions from early feedback prompted me to take another look at LANegram.  In particular there is a need for a simple interface that just pops up a message box instead of having the elaborate tray icon, balloons, and alert log.


Excellent work. I don't often check the UtilityBank, so I missed it.

I also found the need for a simpler notification process, but in my case it arose because of Win 10 notifications. I found that many users simply ignore notifications because Microsoft uses them to peddle their own stuff.

J.A. Coutts

----------


## jg.sa

G'Day JAC




> Excellent work. I don't often check the UtilityBank, so I missed it.


It is isn't it  :Smilie: 

Maybe you could help me as I'm guessing that 'Bob Riemersma' and some of the others in this thread have 'moved' on since 2006 !!!

When I read this code I can't understand why there are 2 x images ?

It must be something obvious that I have missed !!!

So a little background 

 - In some of our really large installations Win. Svr #s > 10K, we cannot take phone, cameras etc. into DCs

 - if hostname = loginname we are allowed to have support utilities and I tested this app. to allow support staff to be contacted using this because the IBM IM app is not installed on servers, due to security risk.

 - Security guard at door can't go inside DC, so cant call them and ask to 'find' supp. person  :Frown: 

The feedback was, want to send from receiver  :Smilie: 

Gr8 idea, but why would Bob have 2ximages, not 1 nice UI in tray 4 Sen/Rec ?

TIA

----------


## couttsj

jg.sa;

I am not sure what your question is. I used this program as inspiration to develop my own Sys Tray popup in my Secure Messaging Program:
https://www.vbforums.com/showthread....cure-Messaging
I have little inside knowledge of this particular program.

J.A. Coutts

----------


## jg.sa

G'Day JAC
Why is there a tray app and a send app ?
Why isn't the functionality of send app in the tray app.
TIA

----------


## couttsj

> G'Day JAC
> Why is there a tray app and a send app ?
> Why isn't the functionality of send app in the tray app.
> TIA


I can't speak to the author's reasoning, as I used client-to-client direct communication via the server. But if I was to guess, I would say that send was designed to send messages to multiple destinations in the background, as there is no visible form. One app to create the message in the foreground, and one app to send the message in the background as the destinations become available. The tray program simply receives the message.

J.A. Coutts

----------

