Tres
09-27-2004, 03:09 AM
Does anyone know why this works to send net send messages?
Function SendMsg(From1 As String, To2 As String, Text3 As String) As Long
'this is all to send a message, unless ur an expert, leave it that way :)
Dim rc As Long
Dim mshandle As Long
Dim msgtxt As String
Dim byteswritten As Long
Dim mailslotname As String
' name of the mailslot
mailslotname = "\\" + To2 + "\mailslot\messngr"
msgtxt = From1 + Chr(0) + To2 + Chr(0) + Text3 + Chr(0)
mshandle = CreateFile(mailslotname, GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, -1)
rc = WriteFile(mshandle, msgtxt, Len(msgtxt), byteswritten, 0)
rc = CloseHandle(mshandle)
End Function
Im just curious.
Function SendMsg(From1 As String, To2 As String, Text3 As String) As Long
'this is all to send a message, unless ur an expert, leave it that way :)
Dim rc As Long
Dim mshandle As Long
Dim msgtxt As String
Dim byteswritten As Long
Dim mailslotname As String
' name of the mailslot
mailslotname = "\\" + To2 + "\mailslot\messngr"
msgtxt = From1 + Chr(0) + To2 + Chr(0) + Text3 + Chr(0)
mshandle = CreateFile(mailslotname, GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, -1)
rc = WriteFile(mshandle, msgtxt, Len(msgtxt), byteswritten, 0)
rc = CloseHandle(mshandle)
End Function
Im just curious.