Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net Send Hook

Status
Not open for further replies.

ClulessChris

IS-IT--Management
Jan 27, 2003
890
GB
Hi I have a project on the go that allows a Small team communicate via DOS Net Send. However the final hurdel is to hook the incoming net send messages. Could somebody please point me in the right direction? Many thanks.
 
Chris,

Are you trying to implement a private/lan net send comm program? Could you be a little more specific?

fwiw most companies and isp's have already blocked netsend protocols at border routers to prohibit spammers from sending 'netsend' messages into there networks.

hth,

Rick
 
Why dont you try the winsock / socket programmeing ?
where all you need to create 20 line server/client code
on tcp/ip , protocol/port

See the Winsock programmeing , its very easy to make one in one day.

net send is problem because its an dos command promt where there is not error number or return value to check is it gone/send or not.! so it will be better if you make a server/client small programe to do that.
 
here is the code for a very small little utility that might get you on your way:

Private Declare Function NetMessageBufferSend Lib _
"netapi32.dll" (yServer As Any, yToName As Byte, _
yFromName As Any, yMsg As Byte, ByVal lSize As Long) As Long

Public Function BroadcastMessage(sToUser As String, _
sMessage As String) As Boolean
Dim yToName() As Byte
Dim yMsg() As Byte

yToName = sToUser & vbNullChar
yMsg = sMessage & vbNullChar
If NetMessageBufferSend(ByVal 0&, yToName(0), ByVal 0&, _
yMsg(0), UBound(yMsg)) = NERR_Success Then
BroadcastMessage = True
End If
End Function


Private Sub cmdSend_Click()
Dim blnSend As Boolean
blnSend = BroadcastMessage(Trim(txtSendTo.Text), Trim(txtToSend.Text))
txtSendTo.Text = ""
txtToSend.Text = ""
txtSendTo.SetFocus
End Sub

 
SkyHawkTech
we have net send as its a closed network I use netsend fine to send the message but need to hook the incoming message on the client side and then place the incoming message in a text box.
jonybd
thanks for the tip I may end up going doen that road.
ServantMan
Thanks very much I give this a go.

Thanks all for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top