This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / MCI functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
MCIOpen (Function)
In french: MCIOuvre
Opens a media file.
// Open the "C:\MyFiles\File.AVI" file
// in the "ImageAVI" Image control
ResExecuteMCI = MCIOpen("C:\MyFiles\File.AVI")
// Play a video "C:\MyFiles\File.AVI" in repeat mode
// Open the video
MCIOpen("C:\MyFiles\File.AVI", "AVI", MciStyleChild, IMG_Video, MciModeNormal)
// Play the video
MCIExécute("Play AVI repeat")
<Result> = MCIOpen(<Media file> [, <Alias name> [, <Type of container object> [, <Container window> [, <Display mode> [, <Parameters> [, <Name of the message window>]]]]]])
<Result>: Boolean
  • True if the file was opened,
  • False otherwise. To get the error number, use MCIErr.
    To get more details on the error, use MCIMsgErr or ErrorInfo with the errMessage constant.
    The status report of the command is returned by MCIRetrieve.
<Media file>: Character string or constant
Name of the media file to be opened (AVI, MP3, etc.) or type of device to open:
MciAudioCDInitializes the audio CD
MciDigitalVideoInitializes the digital video player
MciSequencerInitialize the MDI mixing table
MciVideoDiscInitializes the video player
MciWaveAudioInitializes the .WAV reader
Remark: all the formats supported by the system are supported (which means the CODEC installed on the computer).
<Alias name>: Optional character string
Name used to handle the media file. This name can be used in all the MCI functions.
<Type of container object>: Optional character string
Type of window or control (child window, popup, etc.) in which the media file will be displayed.
MciStyleChildChild window of the current window
MciStyleOverlappedStandard window
MciStylePopupWindow displayed in popup mode
<Container window>: Optional integer or character string
Name or handle of the window or control where the file will be displayed.
Remark: The handle is returned by Handle.
<Display mode>: Optional constant
Mode for displaying the file in the window:
MciModeCenteredImage centered in the window
(Default value)
Image proportionally stretched
MciModeNormalDisplay at 100%
MciModeStretchedImage stretched to occupy the entire surface
<Parameters>: Optional character string
Additional parameters if necessary. These parameters can be known by checking the documentation of the Windows MCI function named "Open".
The MciWait constant can be added to this string. This constant is used to indicate that the program must wait for the end of the MCI command to run the rest of application.
<Name of the message window>: Optional character string
Name of the window used to intercept and manage the different messages sent by MMSYSTEM.DLL. These messages are in MM_xxxxxx format and can be retrieved with Event. You can for example get messages regarding the management of the CD ROM or Joystick.
Component: wd290std.dll
See also
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 06/02/2022

Send a report | Local help