Windows Dev Center

WSManSignalShell function

Sends a control code to an existing command or to the shell itself.

Syntax


void WINAPI WSManSignalShell(
  _In_     HANDLE            shell,
  _In_opt_ HANDLE            command,
           DWORD             flags,
  _In_     PCWSTR            code,
  _In_     WSMAN_SHELL_ASYNC *async,
  _Out_    HANDLE            *signalOperation
);

Parameters

shell [in]

Specifies the handle returned by a WSManCreateShell call. This parameter cannot be NULL.

command [in, optional]

Specifies the command handle returned by a WSManRunShellCommand call. If this value is NULL, the signal code is sent to the shell.

flags

Reserved for future use. Must be set to zero.

code [in]

Specifies the signal code to send to the command or shell. The following codes are common.

CodeMeaning
WSMAN_SIGNAL_SHELL_CODE_TERMINATE

The shell or Command Prompt window was closed.

WSMAN_SIGNAL_SHELL_CODE_CTRL_C

The signal for CTRL+C was received, and the process was halted.

WSMAN_SIGNAL_SHELL_CODE_CTRL_BREAK

The signal for CTRL+BREAK was received, and the process was halted.

 

async [in]

Defines an asynchronous structure. The asynchronous structure contains an optional user context and a mandatory callback function. See the WSMAN_SHELL_ASYNC structure for more information. This parameter cannot be NULL and should be closed by calling the WSManCloseOperation method.

signalOperation [out]

Defines the operation handle for the signal operation. This handle is returned from a successful call of the function and can be used to asynchronously cancel the signal operation. This handle should be closed by calling the WSManCloseOperation method. This parameter cannot be NULL.

Return value

This function does not return a value.

Requirements

Minimum supported client

Windows 7

Minimum supported server

Windows Server 2008 R2

Redistributable

Windows Management Framework on Windows Server 2008 with SP2, Windows Server 2003 with SP2, Windows Vista with SP1, and Windows Vista with SP2

Header

Wsman.h

Library

WsmSvc.lib

DLL

WsmSvc.dll

 

 

Show:
© 2015 Microsoft