Sending alerts to staff on a LAN without using "net send"

Posted on 2006-11-08
Last Modified: 2013-11-13
Our receptionist would like a system where she can alert a particular member of staff when their client has arrived. We are unlikely to use "net send", as this introduces the likelihood of spam messages.

Here's how I envision the setup:
- a "receiving" application running on the staff workstations with a "sending" application running on the receptionist's workstation;
- text string (preset, maybe?) is sent by the receptionist via the LAN, then it would appear as a pop-up at the user's workstation;
- no additional communication is needed from the user to the receptionist;
- the staff do not necessarily use the same computer each time they work - we're networked via a Windows 2003 server, so users are identified by the receptionist by their username;
- ideally the alerts would be those cute little MSN Messenger-style ones with the text string inserted as the label, but I think I can do that part already.

Is this possible to implement without using "net send"? I have some knowledge of VB, but I haven't done much network-based programming.
Question by:skrysiak
  • 3
  • 2
  • 2
  • +2
LVL 41

Expert Comment

ID: 17899626
Most firewalls blocking incomming "net send" messages nowdays... so I'd think that using "net send" within your LAN would be a reasonable (and safe) approach.   Perhaps you might reconsider?

Expert Comment

ID: 17899687
consider using It is like AIM except you control who can log on and keep it business related.

You can make your own but you better of taking a demo chat program written in VB and just customize it your way to save time and the hassle to learn something from scratch.

You can go to and do a search on chat.

Here is one


Assisted Solution

ShelfieldCollege earned 300 total points
ID: 17901975
There are a number of ways you could do this...

The suggestion(s) above are both valid points.  If however you were looking at doing this completely yourself in VB and don't wish to use any previously created applications then you could consider the following:

Use a 'server' application which sits on the receptionists computer.  This application with listen for incoming connections from the client applications (which will sit on the users PCs).

Once the client has connected to the server it can send it a message telling the server who's currently logged onto the station (you can use some API calls to retrieve their username).  The server can then track who's connected from which machine and allow the receptionist to send them messages.

Commonly the connections and transfer of messages between server/client is done using the Winsock control.

As lunchbyte has suggested you can take a look around sites like and where you'll find numerous examples of how to do this.

Hope this has helped, cheers

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

LVL 14

Expert Comment

by:Shiju Sasidharan
ID: 17904407
LVL 14

Expert Comment

by:Shiju Sasidharan
ID: 17904419

Author Comment

ID: 17937624
Okay, I've got a basic setup going on: a client app with a "listener" which waits for a string to be passed from the "server" app.

I've done some searching on and etc, but I can't work out how to use the required API calls. The "server" app needs to retrieve its own username (based upon the current user; we have 3 receptionists), then retrieve the usernames of all logged-in users on the LAN.

Presumably it would then be possible to pass a string to a client app sitting on the workstation of a particular user, selected from a list at the "server" app-side.

Accepted Solution

ShelfieldCollege earned 300 total points
ID: 18065426
The way I would do it is to approach it from a slightly different method.

Have a server application which sits either on one of the receptionist's machines or on a server or some sort, then client applications which connect to the server application.

The server app could use an array of winsock controls to accept multiple connections.

When a client connects it should give the server the name of the person on the local machine and the name of the location machine.  The server should then store this some how, either in a collection or in the Tag property of the winsock control from which the client is connecting.

You could then give the receptionist's the option of sending messages out to everyone or to individual users who are logged in simply by looping the winsock controls currently loaded and checking their tag property, or by looping the collection object, whichever method you chose best.

For performance you would need to keep track of unused winsock controls that you have loaded, e.g. remember to unload the winsock when the user disconnects or when you forcefully disconnect them.  Best thing is to look for some example code on accepting multiple connections using winsock, the majority of these cover different methods of tracking the active controls.

Some example methods of getting the username of the person currently logged on and the name of the computer they are using which can then be sent to the server...

' API Calls
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"
(ByVal lpBuffer As String, nSize As Long) As Long

Declare Function GetComputerName Lib "kernel32" Alias
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

' Public Functions
Public Function GetUser() As String
   On Error GoTo errH

   Dim sUser As String
   Dim lpBuff As String * 1024

   GetUserName lpBuff, Len(lpBuff)
   sUser = Left$(lpBuff, (InStr(1, lpBuff, vbNullChar)) - 1)

   GetUser = sUser
   Exit Function

   GetUser = ""
End Function

Public Function GetComputer() As String

  Dim strBuffer As String * 255

  If GetComputerName(strBuffer, 255&) <> 0 Then
     ' Name exist
     ComputerName = Left(strBuffer, InStr(strBuffer, vbNullChar) - 1)
     ' Name doesn't exist
     ComputerName = "N/A"
  End If

End Function

Note: above isn't my code, it's code I've found on Internet somewhere and I email it myself so I can access it anywhere without having to bookmark anything, so unfortauntely I can't give credit to the original author, can only state I didn't create it myself.  From what I've seen it's a pretty standard way of retrieving this information.



Author Comment

ID: 18130063
Thanks to everyone for their input!

I've now got a program using the code supplied by ShelfieldCollege, utilising the API calls I found in various LAN messenger apps on Planet-Source-Code. With the inclusion of the above code, the same program can be placed on all computers; its functionality changes depending on who is logged in.

Expert Comment

ID: 18131028
Glad you've managed to get your project working, cheers.

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you haven’t already, I encourage you to read the first article ( in my series to gain a basic foundation of R and R Studio.  You will also find the …
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question