HOWTO: Broadcast Messages Using NetMessageBufferSend()

ID: Q131458

The information in this article applies to:

SUMMARY

The NetMessageBufferSend() API can be used to broadcast a message. To broadcast a copy a of a particular message to all workstations running messanger service in a particular domain, the LPWSTR msgname parameter needs to be specified as "DOMAINNAME*" - where DOMAINNAME is the name of the domain to which a message is to be sent. In this case, you can use the following piece of code to call this API:

   #define UNICODE
   #define MESGLEN 50
   WCHAR awcToName[] = TEXT("DomainName*");
   WCHAR awcFromName[] = Text("MyComputer");
   WCHAR awcMesgBuffer[MESGLEN] = Text("This ia Test Message");
   NET_API_STATUS nasStatus;

   nasStatus = NetMessageBufferSend(NULL,
                                    awcToName,
                                    awcFromName,
                                    awcMesgBuffer,
                                    MESGLEN);

Additional query words:
Keywords          : kbnetwork kbAPI kbNTOS350 kbNTOS351 kbSDKPlatform kbNetAPI kbGrpNet 
Issue type        : kbhowto

Last Reviewed: August 6, 1998