PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
MCIOpen (Function)
In French: MCIOuvre
Opens a multimedia file.
Example
// 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
MCIExecute("Play AVI repeat")
Syntax
<Result> = MCIOpen(<Multimedia File> [, <Alias Name> [, <Type of Container Object> [, <Container Window> [, <Display Mode> [, <Parameters> [, <Name of Message Window>]]]]]])
<Result>: Boolean
  • True if the file was opened,
  • False otherwise. To find out the error number, use MCIErr.
    To find out the error details, use MCIMsgErr or ErrorInfo associated with the errMessage constant.
    The status report of command is returned by MCIRetrieve.
<Multimedia File>: Character string (with quotes) or constant
Name of multimedia file to open (AVI, MP3, ...) or type of device to open:
MciAudioCDInitializes the audio CD
MciDigitalVideoInitializes the digital video player
MciVideoDiscInitializes the video player
MciSequencerInitialize the MDI mixing table
MciWaveAudioInitializes the .WAV reader
Note: all the formats supported by the system are supported (which means the CODEC installed on the computer).
<Alias Name>: Optional character string (with or without quotes)
Name used to handle the multimedia file. This name can be used in all the MCI functions.
<Type of Container Object>: Optional character string (with or without quotes)
Type of the window or control (child window, popup, ...) in which the multimedia file will be displayed.
MciStyleOverlappedStandard window
MciStylePopupWindow displayed in popup mode
MciStyleChildChild window of the current window
<Container Window>: Optional integer or character string
Name or handle of the window or control where the file will be displayed.
Note: The handle is returned by Handle.
<Display Mode>: Optional constant
Mode for displaying the file in the window:
MciModeCenteredImage centered in the window
MciModeStretchedImage stretched to occupy the entire surface
MciModeHomotheticCentered
(Default value)
Image proportionally stretched
MciModeNormalDisplay at 100%
<Parameters>: Optional character string (with quotes)
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 Message Window>: Optional character string (with or without quotes)
Name of window used to intercept and manage the different messages sent by MMSYSTEM.DLL. These messages are in MM_xxxxxx format and they can be retrieved via Event. You can for example get messages regarding the management of the CD ROM or Joystick.
Components
WINDEVReports and Queries wd230std.dll
See also
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment