Windows9x中有一个WinPopUp.exe可以在一个Windows网络中收发消息。但WindowsNT中并未提供该程序。
利用WIN32API函数NetMessageBufferSend()可以在一个WindowsNT网络中广播一个消息。
PrivateConstNERR_SuccessAsLong=0&
PrivateDeclareFunctionNetMessageBufferSendLib”NETAPI32.DLL”(ServerAsAny,yToNameAsByte,yFromNameAsAny,yMsgAsByte,ByVallSizeAsLong)AsLong
PublicFunctionSendmsg(strToAsString,strFromAsString,strMessageAsString)AsBoolean
DimbytTo()AsByte
DimbytFrom()AsByte
DimbytMsg()AsByte
bytTo=strTo&vbNullChar
bytName=strFrom&vbNullChar
bytMsg=strMessage&vbNullChar
Sendmsg=(NetMessageBufferSend(ByVal0&,yToName(0),ByVal0&,yMsg(0),UBound(yMsg))=NERR_Success)
EndFunction->