User32BroadcastSystemMessageEx(BroadcastSystemMessageFlags, BroadcastSystemMessageInfo, UInt32, IntPtr, IntPtr, BroadcastSystemMessageExInfo) Method

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.

This function is similar to BroadcastSystemMessage(BroadcastSystemMessageFlags, BroadcastSystemMessageInfo, WindowMessages, IntPtr, IntPtr) except that this function can return more information from the recipients

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static int BroadcastSystemMessageEx(
	BroadcastSystemMessageFlags flags,
	ref BroadcastSystemMessageInfo refInfo,
	uint msg,
	[OptionalAttribute] IntPtr wParam,
	[OptionalAttribute] IntPtr lParam,
	ref BroadcastSystemMessageExInfo refMsgInfo
)

Parameters

flags  BroadcastSystemMessageFlags
The broadcast options.
refInfo  BroadcastSystemMessageInfo
A pointer to a variable that contains and receives information about the recipients of the message.

When the function returns, this variable receives a combination of these values identifying which recipients actually received the message.

msg  UInt32
The message to be sent. See WindowMessages.
wParam  IntPtr  (Optional)
Additional message-specific information.
lParam  IntPtr  (Optional)
Additional message-specific information.
refMsgInfo  BroadcastSystemMessageExInfo
A pointer to a BroadcastSystemMessageExInfo structure that contains additional information if the request is denied and flags is set to Query.

Return Value

Int32
If the function succeeds, the return value is a positive value.

If the function is unable to broadcast the message, the return value is –1.

If the flags parameter is Query and at least one recipient returned BROADCAST_QUERY_DENY to the corresponding message, the return value is zero.

To get extended error information, call GetLastWin32Error.

Remarks

See Also