載入系統配置檔
[與此頁面相關聯的功能 Windows Media Format 11 SDK是舊版功能。 來源讀取器 和 接收寫入器已取代它。 來源讀取器 和 接收寫入器 已針對 Windows 10 和 Windows 11 優化。 Microsoft強烈建議新代碼盡可能使用 Source Reader 和 Sink Writer,而不是 Windows Media Format 11 SDK。 Microsoft建議使用舊版 API 的現有程式代碼,盡可能改寫成使用新的 API。]
若要變更系統設定檔,您必須將它載入設定檔物件。 配置檔管理員提供兩個選項來載入系統配置檔:依標識碼和索引。
系統設定檔識別碼是建立系統配置檔時指派給系統配置檔的 GUID 值。 如需與第 8 版系統配置檔相關聯的 GUID 常數列表,請參閱 系統設定檔。 您可以在頭檔 WMSysPrf.h 中找到舊版的 GUID 常數。 如需 Windows 媒體格式 SDK 隨附之這個和其他頭檔的詳細資訊,請參閱 連結庫檔案和編譯程式設定。
下列範例程式代碼示範如何使用系統配置檔識別碼載入系統設定檔。 若要讓此程式代碼運作,您必須包含 WMSysPrf.h 和 stdio.h。 如需使用此程式碼的詳細資訊,請參閱 使用程式碼範例。
IWMProfileManager* pProfileMgr = NULL;
IWMProfile* pProfile = NULL;
HRESULT hr = S_OK;
// Initialize COM.
hr = CoInitialize(NULL);
// Create a profile manager.
hr = WMCreateProfileManager(&pProfileMgr);
// Retrieve the data for the general-purpose broadband video profile.
hr = pProfileMgr->LoadProfileByID(WMProfile_V80_100Video, &pProfile);
// TODO: Perform whatever customizations are needed. For details about
// editing profiles, see Using Custom Profiles.
// Clean up.
pProfile->Release();
pProfile = NULL;
pProfileMgr->Release();
pProfileMgr = NULL;
如果您不知道要使用哪一個配置檔,您可以使用 GetSystemProfileCount 和 LoadSystemProfileIWMProfileManager 介面的方法逐一查看特定版本的所有系統配置檔。 這些方法一次只會處理一個版本的系統配置檔。 如需變更系統設定檔版本的詳細資訊,請參閱 變更系統設定檔版本。
相關主題