Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

BroadcastSystemMessage (user32)
 
.
Summary
The BroadcastSystemMessage function sends a message to the specified recipients. The recipients can be applications, installable drivers, network drivers, system-level device drivers, or any combination of these system components.

To receive additional information if the request is defined, use the BroadcastSystemMessageEx function.

C# Signature:

[DllImport("user32", SetLastError=true)]
private static extern int BroadcastSystemMessage(MessageBroadcastFlags flags, IntPtr lpInfo, uint Msg, IntPtr wParam, IntPtr lParam);

[DllImport("user32", SetLastError=true)]
private static extern int BroadcastSystemMessage(MessageBroadcastFlags flags, ref MessageBroadcastRecipients lpInfo, uint Msg, IntPtr wParam, IntPtr lParam);

User-Defined Types:

[Flags]
enum MessageBroadcastFlags : uint
{     
    BSF_QUERY            = 0x00000001,
    BSF_IGNORECURRENTTASK       = 0x00000002,
    BSF_FLUSHDISK           = 0x00000004,
    BSF_NOHANG              = 0x00000008,
    BSF_POSTMESSAGE         = 0x00000010,
    BSF_FORCEIFHUNG         = 0x00000020,
    BSF_NOTIMEOUTIFNOTHUNG      = 0x00000040,
    BSF_ALLOWSFW            = 0x00000080,
    BSF_SENDNOTIFYMESSAGE       = 0x00000100,
    BSF_RETURNHDESK         = 0x00000200,
    BSF_LUID            = 0x00000400,
}

[Flags]
enum MessageBroadcastRecipients : uint
{
    BSM_ALLCOMPONENTS       = 0x00000000,
    BSM_VXDS        = 0x00000001,
    BSM_NETDRIVER       = 0x00000002,
    BSM_INSTALLABLEDRIVERS  = 0x00000004,
    BSM_APPLICATIONS    = 0x00000008,
    BSM_ALLDESKTOPS     = 0x00000010,
}

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

MessageBroadcastRecipients recipients = MessageBroadcastRecipients.BSM_APPLICATIONS;

BroadcastSystemMessageRecipients(
     MessageBroadcastFlags.BSF_IGNORECURRENTTASK, // do not send message to this process
     ref recipients,        // broadcast only to applications
     0x1,            // registered private message
     IntPtr.Zero,        // message-specific value
     IntPtr.Zero);        // message-specific value

Alternative Managed API:

Do you know one? Please contribute it!

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions