by Arman Samavatian (3 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 22nd July 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Net sender without sender name's. It's the best sender.
API Declarations
Private Declare Function NetMessageBufferSend Lib "netapi32.dll" (ByVal ServerName As String, ByVal msgname As String, ByVal FromName As String, ByVal Buffer As String, ByVal BufSize As Long) As Long
Sub Go()
Dim a As Double, b As Double, ret As Long, VFrom As String, VMass As String, VTo As String
a = InputBox("How many messages do you want to send?", "")
VFrom = InputBox("From who?", "From")
VMass = InputBox("What is your message?", "Message")
VTo = InputBox("To who do you want to send?", "Adress")
For b = 1 To a
ret = NetSendMessage(VTo, VMass, vbNullString, VFrom)
Next b
End Sub
Function NetSendMessage(sSendTo As String, sMessage As String, Optional ServerName As String = vbNullString, Optional FromName As String = vbNullString) As Long
NetSendMessage = NetMessageBufferSend(StrConv(ServerName, vbUnicode), StrConv(sSendTo, vbUnicode), StrConv(FromName & vbNullString, vbUnicode), StrConv(sMessage, vbUnicode), Len(StrConv(sMessage, vbUnicode)))
End Function
((( Form )))
You don't need to add any thing to form
Option Explicit
Private Sub Form_Activate()
Print "Click here to send"
End Sub
Private Sub Form_Click()
Dim a As String
a = MsgBox("Do you want to send a message?", vbYesNo + vbMsgBoxHelpButton + vbQuestion + vbSystemModal, "Send")
Select Case a
Case vbYes
Call Go
Case vbNo
End
Case vbMsgBoxHelpButton
MsgBox "If you press yes you can send some messages to a computer." & vbNewLine & "If you press no this program will finished soon." & vbNewLine, vbOKOnly + vbExclamation, "Help"
End Select
End Sub
Private Sub Form_Load()
Dim a As String
a = MsgBox("Do you want to send a message?", vbYesNo + vbMsgBoxHelpButton + vbQuestion + vbSystemModal, "Send")
Select Case a
Case vbYes
Call Go
Case vbNo
End
Case vbMsgBoxHelpButton
MsgBox "If you press yes you can send some messages to a computer." & vbNewLine & "If you press no this program will finished soon." & vbNewLine, vbOKOnly + vbExclamation, "Help"
End Select
End Sub