[與此頁面相關聯的功能 MCI是舊版功能。 MediaPlayer已取代它。 MediaPlayer 已針對 Windows 10 和 Windows 11 優化。 Microsoft強烈建議新程式代碼盡可能使用 MediaPlayer,而不是 MCI。 Microsoft建議使用舊版 API 的現有程式代碼,盡可能改寫成使用新的 API。]
如果您的應用程式開啟多個檔案,它應該包含如下列簡單函式的例程。 應用程式會在初始化期間使用 「initAVI」 函式,並在終止期間使用 「termAVI」 函式。 這些函式只會封裝 mciSendString 函式。
// Initialize the MCIAVI driver. This returns TRUE if OK,
// FALSE on error.
BOOL initAVI(VOID)
{
// Perform additional initialization before loading first file.
return mciSendString("open digitalvideo", NULL, 0, NULL) == 0;
}
// Close the MCIAVI driver.
void termAVI(VOID)
{
mciSendString("close digitalvideo", NULL, 0, NULL);
}