WinMMMciSendString Method

Sends a command string to an MCI device. The device that the command is sent to is specified in the command string.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("WinMM.dll", EntryPoint = "mciSendString", CharSet = CharSet.Auto, 
	BestFitMapping = false, ThrowOnUnmappableChar = true, SetLastError = true)]
public static int MciSendString(
	string command,
	StringBuilder buffer,
	int bufferSize,
	IntPtr hWndCallback
)

Parameters

command  String
Pointer to a null-terminated string that specifies an MCI command string. For a list, see https://msdn.microsoft.com/en-us/library/windows/desktop/dd743572(v=vs.85).aspx.
buffer  StringBuilder
StringBuilder that receives return information. If no return information is needed, this parameter can be .
bufferSize  Int32
Size, in characters, of the return buffer specified by the buffer parameter.
hWndCallback  IntPtr
A IntPtr to a callback window if the "notify" flag was specified in the command string.

Return Value

Int32
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(Int32, StringBuilder, Int32) function

Remarks

See Also