3.3.4.1.10 RpcShowMessageBox (Opnum 9)

The RpcShowMessageBox method displays a message box, with specified message and title, in the target user session running on the terminal server. This method MUST be called after RpcOpenSession. The caller MUST have WINSTATION_MSG permission for the session. The method checks whether the caller has WINSTATION_MSG permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.

 HRESULT RpcShowMessageBox(
   [in] SESSION_HANDLE hSession,
   [in, string] WCHAR* szTitle,
   [in, string] WCHAR* szMessage,
   [in] ULONG ulStyle,
   [in] ULONG ulTimeout,
   [out] ULONG* pulResponse,
   [in] BOOL bDoNotWait
 );

hSession: The handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE.

szTitle: The title to assign to the message box.

szMessage: The message to display inside the message box.

ulStyle: Specifies the contents and behavior of the message box. This parameter can be a combination of flags specified for the uType parameter of the MessageBox function as defined in [MSDN-MSGBOX].

ulTimeout: The time in seconds for which to display the message box. This time-out value is managed by another system component which dismisses the message box if no user input is entered during this interval.

pulResponse: Pointer to a variable that receives the user's response, which can be one of the following values. The values defined in [MSDN-MSGBOX].

Value

Meaning

IDABORT

3

The Abort button was selected.

IDCANCEL

2

The Cancel button was selected.

IDIGNORE

5

The Ignore button was selected.

IDNO

7

The No button was selected.

IDOK

1

The OK button was selected.

IDRETRY

4

The Retry button was selected.

IDYES

6

The Yes button was selected.

IDASYNC

32001

The bDoNotWait parameter was TRUE, so the function returned without waiting for a response.

IDTIMEOUT

32000

The bDoNotWait parameter was FALSE and the time-out interval elapsed.

bDoNotWait: Set to FALSE to wait for the message box to time-out or close, TRUE otherwise.

Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.

Return value/code

Description

0x00000000

S_OK

Successful completion.