MCI_BREAK command

The MCI_BREAK command sets a break key for an MCI device. MCI supports this command directly rather than passing it to the device. Any MCI application can use this command.

To send this command, call the mciSendCommand function with the following parameters.

MCIERROR mciSendCommand(
  MCIDEVICEID wDeviceID, 
  MCI_BREAK, 
  DWORD dwFlags, 
  (DWORD) (LPMCI_BREAK_PARMS) lpBreak
);

Parameters

wDeviceID

Device identifier of the MCI device that is to receive the command message.

dwFlags

MCI_NOTIFY, MCI_WAIT, or, for digital-video and video-cassette recorder (VCR) devices, MCI_TEST. For information about these flags, see The Wait, Notify, and Test Flags.

lpBreak

Pointer to an MCI_ BREAK_PARMS structure.

Return Value

Returns zero if successful or an error otherwise.

Remarks

You might have to press the break key multiple times to interrupt a wait operation. Pressing the break key after a device wait is canceled can send the break to an application. If an application has an action defined for the virtual-key code, then it can inadvertently respond to the break. For example, an application using VK_CANCEL for an accelerator key can respond to the default CTRL+BREAK key if it is pressed after a wait is canceled.

The following additional flags apply to all devices:

MCI_BREAK_HWND

The hwndBreak member of the structure identified by lpBreak contains a window handle that must be the current window in order to enable break detection for that MCI device. This is usually the application's main window. If omitted, MCI does not check the window handle of the current window.

MCI_BREAK_KEY

The nVirtKey member of the structure identified by lpBreak specifies the virtual-key code used for the break key. By default, MCI assigns CTRL+BREAK as the break key. This flag is required if MCI_BREAK_OFF is not specified.

MCI_BREAK_OFF

Disables any existing break key for the indicated device.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Mmsystem.h (include Windows.h)

See also

MCI

MCI Commands