vfp5.0中有这样的例子
加入ActiveX控件 Mircosoft MCI Control 主要的代码如下:
Open按扭的click 
!* Check to make sure a media file is not already open
cCmd = ("STATUS FoxMedia READY")
IF THISFORM.doMCI(cCmd) = "true" THEN
*!* If one is, close it
cCMD = ("CLOSE FoxMedia WAIT")
THISFORM.doMCI(cCmd)

*!* And use the custom Disable method of the form to disable
*!* all appropriate controls
THISFORM.disable(.T.)
ENDIF*!* Prompt the user for the media file to open
cFileName = GETFILE("avi|mov|wav|mid","Select file to play")
IF !EMPTY(cFileName) THEN

_SCREEN.MousePointer = 11
THISFORM.lblLoading.visible = .T. *!* Need to use window handle functions in FoxTools
SET LIBRARY TO HOME() + ".\FOXTOOLS.FLL"
EXTERNAL PROCEDURE MainHWND
EXTERNAL PROCEDURE _WhToHwnd
EXTERNAL PROCEDURE _WOnTop

* Returns Handle of Main VFP Window
Main_hWnd = MainHWND() * Get Handle of the form with FOXTOOLS.FLL
cur_window = _WhToHwnd(_WOnTop()) NullPointer = 0

*!* Set up open MCI command into string variable
cCmd = ('OPEN "' + cFileName + '" alias FoxMedia' + ;
  ' style child parent ' + ALLTRIM(STR(cur_window)) + ' WAIT') *!* Execute the MCI command
THISFORM.doMCI(cCmd) *!* Check to see if MCI command succeeded
IF THISFORM.MCIerror > 0 THEN
*!* If not, it might be a non-visual media
*!* We'll try to open it without setting the window parent
cCmd = ('OPEN "' + cFileName + '" alias FoxMedia WAIT')
THISFORM.doMCI(cCmd)
IF THISFORM.MCIerror > 0 THEN
*!* Nope, still won't open.  Some other error.  
*!* Let's show the user the MCI error and get out
messagebox(THISFORM.MCIerrorString)
THISFORM.lblLoading.visible = .F.
_SCREEN.MousePointer = 0
RETURN
ELSE
*!* It's not a visual media, so let's show a label
*!* to let the user know the media has been loaded
THISFORM.lblNonVisual.visible = .T.
ENDIF
ELSE
*!* It does have visual media, so we need to set up the window
*!* it will play in.

*!* Get the window handle of the window playing the video
cCmd = "status FoxMedia window handle wait"
hWin = INT(VAL(THISFORM.doMCI(cCmd)))

*!* Once we have the window handle, we need to position
*!* the video window to be the same position and size
*!* as our player rectangle on the form
x1Pos = THISFORM.player.LEFT
y1Pos = THISFORM.player.TOP
x2Pos = THISFORM.player.width
y2pos = THISFORM.player.height *!* Use the SetWindowPos Windows function to set position and size
setWindowPos(hWin,0,x1Pos,y1Pos,x2Pos,y2Pos,0) *!* Everything's done, let's show the video
cCmd = ("WINDOW FoxMedia state show")
THISFORM.doMCI(cCmd) ENDIF *!* Set the device to use milliseconds when setting/getting position
THISFORM.doMCI("SET FoxMedia time format milliseconds") *!* Enable all appropriate controls
THISFORM.disable(.F.)

THISFORM.lblLoading.visible = .F.
_SCREEN.MousePointer = 0
ENDIFplay 代码*!* First need to see if the media is at the end 
*!* by comparing the total length with the current position
nMediaLength = VAL(THISFORM.doMCI("STATUS FoxMedia length"))
nMediaPosition = VAL(THISFORM.doMCI("STATUS FoxMedia position"))IF nMediaPosition >= nMediaLength THEN
*!* The media is at the end, so we need to seek back to the start
*!* of the clip before playing
THISFORM.doMCI("SEEK FoxMedia to start WAIT")
ENDIF*!* Now we can play the media
THISFORM.doMCI("PLAY FoxMedia")
IF THISFORM.MCIerror > 0 THEN
THISFORM.showMCIerror
ELSE
THISFORM.timer1.interval = 360
ENDIF详细请参考vfp5.0自带的实例