OPEN
Appearance
The OPEN command is used to open or create a new device instance. OPEN returns a device ID that is used for subsequent calls for the procedure interface, if desired.
Syntax
┌──────────────────────────┐
│ │
OPEN ──── object ─┴──┬────────────────────┬──┴──┬──────────┬──┤
├─ ALIAS devicealias ┤ ├─ WAIT ─┤
├─ DOSQUEUE ─────────┤ └─ NOTIFY ─┘
├─ READONLY ─────────┤
├─ SHAREABLE ────────┤
└─ TYPE devicetype ──┘
Keywords
- object
- Object associated with this media control interface command. The object can be one of the following:
- Device type
- Device name
- Filename
- Alias
- ALIAS devicealias
- Specifies an alternate name for the given device. If an alias is specified, it must be used in subsequent references to avoid automatic open. An alias can be any word that is not a keyword, any valid filename, or any string of words enclosed in double quotes (e.g., "CD Player"). Leading and trailing blanks are ignored; internal blanks are preserved. It is case-insensitive.
- DOSQUEUE
- If a device instance is opened with the DOSQUEUE keyword specified, window handles that are passed in for the instance will be treated as OS/2 Control Program queue handles.
- READONLY
- Specifies that the file is to be opened in read-only mode.
- SHAREABLE
- Initializes the device as shareable. Specifying shareable makes the resources of the device available to other device contexts. If SHAREABLE is not specified with OPEN, the resource will be exclusively acquired when the device is opened.
- TYPE devicetype
- Specifies the compound device used to control a device element. As an alternative to TYPE, an application can specify the name of a file to be opened. The media control interface uses the file EA or extension associated with the file to select the controlling device.
- WAIT
- The command is executed synchronously. The function waits until the requested action is complete before returning to the application.
- NOTIFY
- The command is executed asynchronously, allowing control to be returned immediately to the application. When the requested action is complete, an MM_MCINOTIFY message is sent to the application window procedure.
Example
open applause.wav shareable alias wfile wait play wfile notify