sending a message from one machine to the other in LAN ......
-
hello to all i am using this code to send a message from my system (sys 1) to the other system (sys 2). its working fine..... for this i need to use APIs. but i want to send a message using the shell command. can any body give the exact syntax for it ?. next one ... is there any way to know in/from the sencond system (sys 2) ( ... to which i am sending the message ) that it has got the message when ever i send a message to sys 2 ?. so that i can show a popup (just like msn messenger do) or play some sound when ever sys 2 gets a message from sys 1. here is the code ... 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 Private Const NERR_Success As Long = 0& Public Function BroadcastMessage(sToUser As String, sFromUser As String, sMessage As String) As Boolean Dim yToName() As Byte Dim yFromName() As Byte Dim yMsg() As Byte Dim l As Long yToName = sToUser & vbNullChar yFromName = sFromUser & 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 Command1_Click() Dim x As Boolean x = BroadcastMessage(TxtTo.Text, TxtFrom.Text, TxtMsg.Text) If x Then MsgBox "Message Sent" Else MsgBox "Message Not Sent" End If End Sub any body please help me Mohan G