Compartilhar via


mciSendString function

The mciSendString function sends a command string to an MCI device. The device that the command is sent to is specified in the command string.

Syntax

MCIERROR mciSendString(
   LPCTSTR lpszCommand,
   LPTSTR  lpszReturnString,
   UINT    cchReturn,
   HANDLE  hwndCallback
);

Parameters

  • lpszCommand
    Pointer to a null-terminated string that specifies an MCI command string. For a list, see Multimedia Command Strings.

  • lpszReturnString
    Pointer to a buffer that receives return information. If no return information is needed, this parameter can be NULL.

  • cchReturn
    Size, in characters, of the return buffer specified by the lpszReturnString parameter.

  • hwndCallback
    Handle to a callback window if the "notify" flag was specified in the command string.

Return value

Returns zero if successful or an error otherwise. The low-order word of the returned DWORD value contains the error return value. If the error is device-specific, the high-order word of the return value is the driver identifier; otherwise, the high-order word is zero. For a list of possible error values, see MCIERR Return Values.

To retrieve a text description of return values, pass the return value to the mciGetErrorString function.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Mmsystem.h (include Windows.h)

Library

Winmm.lib

DLL

Winmm.dll

Unicode and ANSI names

mciSendStringW (Unicode) and mciSendStringA (ANSI)

See also

MCI

MCI Functions

Command Strings