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

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.

C# Signature:

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern int BroadcastSystemMessageEx(uint flags, ref uint lpInfo, uint Msg, [MarshalAs(UnmanagedType.SysUInt)] ulong wParam, [MarshalAs(UnmanagedType.SysInt)] long lParam, out BSMINFO pbsmInfo);

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

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

C# Signature:

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

Notes:

None.

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

User-Defined Types:

Tips & Tricks:

Please add some!

[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,
}

Sample Code:

Please add some!

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

Notes:

None.

Documentation

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
Edit This Page
Find References
Show Printable Version
Revisions