Share via


IOCTL_CONSOLE_SETCONTROLCEVENT (Compact 2013)

3/28/2014

This I/O control message allows a console application to stop its current process by using the keyboard command CRTL+C. Send this message with DeviceIoControl.

This replaces the deprecated IOCTL_CONSOLE_SETCONTROLCHANDLER.

Syntax

BOOL DeviceIoControl(
    HANDLE hDevice,           // handle to device
    DWORD dwIoControlCode,    // use to IOCTL_CONSOLE_SETCONTROLCEVENT
    LPVOID lpInBuffer,        // pointer to input buffer
    DWORD nInBufferSize,      // input buffer size
    LPVOID lpOutBuffer,       // pointer to output buffer
    DWORD nOutBufferSize,     // output buffer size
    LPDWORD lpBytesReturned,  // number of bytes returned
    OVERLAPPED lpOverlapped   // pointer to OVERLAPPED structure
);

Parameters

  • hDevice
    [in] Handle to the device.
  • dwIoControlCode
    [in] Control code for the operation. Use IOCTL_CONSOLE_SETCONTROLCEVENT for this operation.
  • lpInBuffer
    [in] Set to the handle for the console's current process.
  • nInBufferSize
    [in] Set to sizeof(DWORD).
  • lpOutBuffer
    [out] Not used; set to NULL.
  • nOutBufferSize
    [out] Not used; set to zero.
  • lpBytesReturned
    [out] Not used; set to NULL.
  • lpOverlapped
    [out] Not used; set to NULL.

Return Values

Returns TRUE if successful; otherwise, returns FALSE.

Calling this the first time will turn enable the console to stop the indicated process by using CTRL+C. Passing the same process in on a second call will disable the console from stopping the process on CTRL+C.

Requirements

Header

console.h

See Also

Reference

Console IOCTLs

Other Resources

OAL IOCTLs