|
TerminalServicesHelperWTSSendMessage Method |
Displays a message box on the client desktop of a specified Remote Desktop Services session.
WTSSendMessage function Namespace: Xcalibur.NativeMethods.V2.TerminalServicesAssembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax [DllImportAttribute("wtsapi32.dll", SetLastError = true)]
public static bool WTSSendMessage(
IntPtr serverHandle,
int sessionId,
string title,
int titleLength,
string message,
int messageLength,
int style,
int timeout,
out int response,
bool wait
)
<DllImportAttribute("wtsapi32.dll", SetLastError := true>]
Public Shared Function WTSSendMessage (
serverHandle As IntPtr,
sessionId As Integer,
title As String,
titleLength As Integer,
message As String,
messageLength As Integer,
style As Integer,
timeout As Integer,
<OutAttribute> ByRef response As Integer,
wait As Boolean
) As Boolean
public:
[DllImportAttribute(L"wtsapi32.dll", SetLastError = true)]
static bool WTSSendMessage(
IntPtr serverHandle,
int sessionId,
String^ title,
int titleLength,
String^ message,
int messageLength,
int style,
int timeout,
[OutAttribute] int% response,
bool wait
)
[<DllImportAttribute("wtsapi32.dll", SetLastError = true)>]
static member WTSSendMessage :
serverHandle : IntPtr *
sessionId : int *
title : string *
titleLength : int *
message : string *
messageLength : int *
style : int *
timeout : int *
response : int byref *
wait : bool -> bool
Parameters
- serverHandle IntPtr
- A handle to an RD Session Host server. Specify a handle opened
by the function, or specify WTS_CURRENT_SERVER_HANDLE to
indicate the RD Session Host server on which your application is running.
- sessionId Int32
- A Remote Desktop Services session identifier. To indicate the
current session, specify WTS_CURRENT_SESSION. You can use the
function to retrieve the identifiers of all
sessions on a specified RD Session Host server.
- title String
- A pointer to a null-terminated string for the title bar of the message
box.
- titleLength Int32
- The length, in bytes, of the title bar string.
- message String
- A pointer to a null-terminated string that contains the message to
display.
- messageLength Int32
- The length, in bytes, of the message string.
- style Int32
- The contents and behavior of the message box. This value is typically
.
- timeout Int32
- The time, in seconds, that the
function waits for the user's response. If the user does not respond within the time-out
interval, the response parameter returns . If
the Timeout parameter is zero, waits indefinitely for the
user to respond.
- response Int32
- A pointer to a variable that receives the user's response of type
- wait Boolean
- If TRUE, does not return until the user
responds or the time-out interval elapses. If the Timeout parameter is zero, the function
does not return until the user responds.
If FALSE, the function returns immediately and the response parameter returns
. Use this method for simple information
messages (such as print job–notification messages) that do not need to return the user's
response to the calling program.
Return Value
BooleanIf the function succeeds, the return value is nonzero. To determine whether the
function adjusted all of the specified privileges, call
.
See Also Reference
WTSSendMessage(IntPtr, Int32, String, Int32, String, Int32, Int32, Int32, Int32, Boolean)
WTSSendMessage(IntPtr, Int32, String, Int32, String, Int32, Int32, Int32, Int32, Boolean)
WTSSendMessage(IntPtr, Int32, String, Int32, String, Int32, Int32, Int32, Int32, Boolean)