Home   Index   About
Ultimate Pack


Custom Search
Overview
Group
Quick Info

MCI_OPEN

The MCI_OPEN command initializes a device or file. All devices recognize this command.

MCIERROR mciSendCommand(MCIDEVICEID wDeviceID, MCI_OPEN,
DWORD dwFlags, (DWORD) (LPMCI_OPEN_PARMS) lpOpen);

Parameters

wDeviceID

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

dwFlags

MCI_NOTIFY or MCI_WAIT. For information about these flags, see The Wait, Notify, and Test Flags.

lpOpen

Address of an MCI_OPEN_PARMS structure. (Devices with extended command sets might replace this structure with a device-specific structure.)

Return Values

Returns zero if successful or an error otherwise.

Remarks

The MCI_OPEN_TYPE flag must be used whenever a device is specified in the mciSendCommand function. If you open a device by specifying a device-type constant, you must specify the MCI_OPEN_TYPE_ID flag in addition to MCI_OPEN_TYPE. For a list of device-type constants, see Constants: Device Types.

If the MCI_OPEN_SHAREABLE flag is not specified when a device or file is initially opened, all subsequent MCI_OPEN commands to the device or file will fail. If the device or file is already open and this flag is not specified, the call will fail even if the first open command specified MCI_OPEN_SHAREABLE. Files opened for the MCISEQ.DRV and MCIWAVE.DRV devices are nonshareable.

Case is ignored in the device name, but there cannot be leading or trailing blanks.

To use automatic type selection (via the entries in the registry), assign the filename and file extension to the lpstrElementName member of the structure identified by lpOpen, set the lpstrDeviceType member to NULL, and set the MCI_OPEN_ELEMENT flag.

The following additional flags apply to all devices supporting MCI_OPEN:

MCI_OPEN_ALIAS

An alias is included in the lpstrAlias member of the structure identified by lpOpen.

MCI_OPEN_SHAREABLE

The device or file should be opened as shareable.

MCI_OPEN_TYPE

A device type name or constant is included in the lpstrDeviceType member of the structure identified by lpOpen.

MCI_OPEN_TYPE_ID

The low-order word of the lpstrDeviceType member of the structure identified by lpOpen contains a standard MCI device type identifier and the high-order word optionally contains the ordinal index for the device. Use this flag with the MCI_OPEN_TYPE flag.

The following additional flags apply to compound devices:

MCI_OPEN_ELEMENT

A filename is included in the lpstrElementName member of the structure identified by lpOpen.

MCI_OPEN_ELEMENT_ID

The lpstrElementName member of the structure identified by lpOpen is interpreted as a doubleword value and has meaning internal to the device. Use this flag with the MCI_OPEN_ELEMENT flag.

The following additional flags are used with the digitalvideo device type:

MCI_DGV_OPEN_NOSTATIC

The device should reduce the number of static (system) colors in the palette. This increases the number of colors available for rendering the video stream. This flag applies only to devices that share a palette with Windows.

MCI_DGV_OPEN_PARENT

The parent window handle is specified in the hWndParent member of the structure identified by lpOpen.

MCI_DGV_OPEN_WS

A window style is specified in the dwStyle member of the structure identified by lpOpen.

MCI_DGV_OPEN_16BIT

Indicates a preference for 16-bit MCI device support.

MCI_DGV_OPEN_32BIT

Indicates a preference for 32-bit MCI device support.

For digital-video devices, the lpOpen parameter points to an MCI_DGV_OPEN_PARMS structure.

The following additional flags are used with the overlay device type:

MCI_OVLY_OPEN_PARENT

The parent window handle is specified in the hWndParent member of the structure identified by lpOpen.

MCI_OVLY_OPEN_WS

A window style is specified in the dwStyle member of the structure identified by lpOpen. The dwStyle value specifies the style of the window that the driver will create and display if the application does not provide one. The style parameter takes an integer that defines the window style. These constants are the same as the standard window styles (such as WS_CHILD, WS_OVERLAPPEDWINDOW, or WS_POPUP).

For video-overlay devices, the lpOpen parameter points to an MCI_OVLY_OPEN_PARMS structure.

The following additional flag is used with the waveaudio device type:

MCI_WAVE_OPEN_BUFFER

A buffer length is specified in the dwBufferSeconds member of the structure identified by lpOpen.

For waveform-audio devices, the lpOpen parameter points to an MCI_WAVE_OPEN_PARMS structure. The MCIWAVE driver requires an asychronous waveform-audio device.

See Also

CreateWindow
, MCI_DGV_OPEN_PARMS, MCI_OPEN_PARMS, MCI_OVLY_OPEN_PARMS, MCI_WAVE_OPEN_PARMS, mciSendCommand


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2011 Free Tech Secrets ;) greatis just4fun network just4fun