共用方式為


mciGetDeviceID function

The mciGetDeviceID function retrieves the device identifier corresponding to the name of an open device.

Syntax

MCIDEVICEID mciGetDeviceID(
   LPCTSTR lpszDevice
);

Parameters

  • lpszDevice
    Pointer to a null-terminated string that specifies the device name or the alias name by which the device is known.

Return value

Returns the device identifier assigned to the device when it was opened if successful. The identifier is used in the mciSendCommand function. If the device name is not known, if the device is not open, or if there was not enough memory to complete the operation, the return value is zero.

Remarks

Each file for a compound device has a unique device identifier. The identifier of the "all" device is MCI_ALL_DEVICE_ID.

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

mciGetDeviceIDW (Unicode) and mciGetDeviceIDA (ANSI)

See also

MCI

MCI Functions