Index   Commented   Search   About

Playing the AVI File

Before using the mciSendCommand function to send the MCI_PLAY command, your application allocates the memory for the structure, initializes the members it will use, and sets the flags corresponding to the members used in the structure. (If your application does not set a flag for a structure member, MCI drivers ignore the member.) For example, the following example plays a movie from the starting position specified by dwFrom to the ending position specified by dwTo. (If either position is zero, the example is written so that the position is not used.)

DWORD PlayMovie(WORD wDevID, DWORD dwFrom, DWORD dwTo)

{

MCI_DGV_PLAY_PARMS mciPlay; // play parameters

DWORD dwFlags = 0;

// Check dwFrom. If it is != 0 then set parameters and flags.

if (dwFrom){

mciPlay.dwFrom = dwFrom; // set parameter

dwFlags |= MCI_FROM; // set flag to validate member

}

// Check dwTo. If it is != 0 then set parameters and flags.

if (dwTo){

mciPlay.dwTo = dwTo; // set parameter

dwFlags |= MCI_TO; // set flag to validate member

}

// Send the MCI_PLAY command and return the result.

return mciSendCommand(wDevID, MCI_PLAY, dwFlags,

(DWORD)(LPVOID)&mciPlay);

}

Related Links

Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder

More Online Helps

Win32 Programmer's Reference (win32.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008 Free Tect Secrets ;) greatis just4fun network just4fun