Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send Message
Message
From
11/03/1998 15:25:41
 
 
To
10/03/1998 10:47:08
General information
Forum:
Windows
Category:
API
Title:
Miscellaneous
Thread ID:
00083632
Message ID:
00083994
Views:
24
>Someone know how can I do to send a simple message
>like NET SEND using API, in Win95 and WinNT?
>
>Also Send a message to many users at same time...

This may help with part of what you are looking for

Send Messages to WINPOPUP from your app:
Great for things that need to run "unattended" and you want it to alert you if something goes wrong, your application can send you a message through WinPopUp. WinPopUp uses a mail slot to communicate with other computers in the network. Choose a mail slot name, such as \\computername
\mailslot\messngr, and use this code:

Option Explicit

Private Declare Function CloseHandle Lib _
"kernel32" (ByVal hHandle As Long) As Long
Private Declare Function WriteFile Lib _
"kernel32" (ByVal hFileName As Long, _
ByVal lpBuff As Any, _
ByVal nNrBytesToWrite As Long, _
lpNrOfBytesWritten As Long, _
ByVal lpOverlapped As Long) As Long
Private Declare Function CreateFile Lib _
"kernel32" Alias "CreateFileA" ( _
ByVal lpFileName As String, _
ByVal dwAccess As Long, _
ByVal dwShare As Long, _
ByVal lpSecurityAttrib As Long, _
ByVal dwCreationDisp As Long, _
ByVal dwAttributes As Long, _
ByVal hTemplateFile As Long) As Long

Private Const OPEN_EXISTING = 3
Private Const GENERIC_READ = &H80000000
Private Const GENERIC_WRITE = &H40000000
Private Const GENERIC_EXECUTE = &H20000000
Private Const GENERIC_ALL = &H10000000
Private Const INVALID_HANDLE_VALUE = -1
Private Const FILE_SHARE_READ = &H1
Private Const FILE_SHARE_WRITE = &H2
Private Const FILE_ATTRIBUTE_NORMAL = &H80

Function SendToWinPopUp(PopFrom As String, _
PopTo As String, MsgText As String) As Long
' parms: PopFrom: user or computer that
' sends the message
' PopTo: computer that receives the
' message
' MsgText: the text of the message
' to send
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 = "\\" + PopTo + _
"\mailslot\messngr"
msgtxt = PopFrom + Chr(0) + PopTo + Chr(0) + _
MsgText + Chr(0)
mshandle = CreateFile(mailslotname, _
GENERIC_WRITE, FILE_SHARE_READ, 0, _
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
rc = WriteFile(mshandle, msgtxt, _
Len(msgtxt), byteswritten, 0)
rc = CloseHandle(mshandle)
End Function

This code is great and can be converted for foxpro or whatever you need.
HTH
Robert Horkay
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform