下列 Windows 多媒體函式提供呼叫端將訊息傳遞至舊版音訊裝置的方法:
其中一些裝置訊息由裝置驅動程式直接處理,而有些則由系統代表裝置處理。
本節只會討論系統攔截的訊息,並處理而不會傳遞至裝置驅動程式。 系統截獲的訊息可以取得語音通訊或一般音訊使用的偏好裝置。 此外,系統截獲的訊息可以提供特定裝置的下列相關資訊:
裝置介面名稱
如需裝置介面名稱的相關資訊,請參閱 裝置介面簡介。
裝置的隨插即用開發節點號碼
For information about devnodes, see Device Tree.
對應程式是否可以使用裝置
映射器通過將應用程序的需求映射到系統中的一個可用設備來選擇適當的設備。 如需對應程式的詳細資訊,請參閱 Microsoft Windows SDK 檔。
如需其他類型裝置訊息的相關資訊,請參閱 Windows SDK 檔。
An XxxMessage function has the following syntax:
DWORD XxxMessage(
<device ID>,
UINT uMsg,
DWORD_PTR dwParam1,
DWORD_PTR dwParam2
);
第一個參數是裝置 ID。 The auxOutMessage function definition specifies this parameter to be of type UINT, as expected. However, in the case of waveInMessage, waveOutMessage, midiInMessage, midiOutMessage, or mixerMessage, the caller must cast the device ID to handle type HWAVEIN, HWAVEOUT, HMIDIIN, HMIDIOUT, or HMIXER, respectively. 請注意,如果呼叫端提供有效的控制碼,而不是此參數的裝置識別碼,則函式會失敗,並傳回錯誤碼 MMSYSERR_NOSUPPORT。
The uMsg parameter specifies a message value (for example, DRV_QUERYDEVICEINTERFACE). 如需驅動程式特定訊息的清單,請參閱標頭檔 Mmddk.h。
The meaning of parameters dwParam1 and dwParam2 depends on the message. For example, a particular message might require that dwParam1 be a ULONG value; the caller must cast this value to type DWORD_PTR to satisfy the function definition.
如果呼叫成功,函式會傳回 MMERR_NOERROR,如果未成功,則會傳回錯誤狀態碼。
For more information about the XxxMessage functions, see the Windows SDK documentation.
標頭檔 Mmddk.h 會定義下列系統截獲的裝置訊息:
如需詳細資訊,請參閱 取得裝置介面名稱。
如需詳細資訊,請參閱 取得裝置介面名稱。
查詢裝置的 devnode 號碼。
查詢對應程式是否可以使用裝置。
DRVM_MAPPER_CONSOLEVOICECOM_GET
如需詳細資訊,請參閱 偏好 Voice-Communications 裝置 ID。
如需詳細資訊,請參閱 存取慣用裝置 ID。