Private Declare Function NetMessageBufferSend Lib "NETAPI32.DLL" _
(Server As Any, _
yToName As Byte, _
yFromName As Any, _
yMsg As Byte, _
ByVal lSize As Long) _
As Long
Private Sub Command1_Click()
Dim X As Boolean
X = SendMsg(TxtTo.Text, TxtFrom.Text, TxtMsg.Text)
If X Then
MsgBox "消息已被成功发送", vbInformation, "发送消息"
Else
MsgBox "发送消息失败", vbCritical, "发送消息"
End If
End Sub
Private Function SendMsg(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