共用方式為


WIA 驅動程式命令支援

WIA 裝置命令是 WIA 服務 (代表映像應用程式) 傳送至 WIA 迷你驅動程式的要求,指示它執行特定動作。

以下是可發出給迷你驅動程式的 WIA 裝置命令清單:

Command Meaning
WIA_CMD_CHANGE_DOCUMENT 變更為下一個文件 (僅發行給多文件掃描器)。
WIA_CMD_DELETE_ALL_ITEMS 刪除驅動程式項目樹狀結構。
WIA_CMD_DIAGNOSTIC 由 Microsoft 保留。
WIA_CMD_SYNCHRONIZE 重建驅動程式項目樹狀結構。 所有迷你驅動程式都必須支援此命令。
WIA_CMD_TAKE_PICTURE 拍照(只發給相機)。
WIA_CMD_UNLOAD_DOCUMENT 卸除目前的檔(僅發行給多檔掃描器)。

WIA_CMD_XXX命令在Microsoft Windows SDK 檔中說明。 您可以包含自己的自訂命令清單。

新增裝置命令支援

To properly set up your WIA minidriver to report device commands, report an array of supported commands in the IWiaMiniDrv::drvGetCapabilities method. For an example implementation of the IWiaMiniDrv::drvGetCapabilities method, see Adding Interrupt Event Support.

實作 IWiaMiniDrv::d rvDeviceCommand 方法

The WIA service calls the IWiaMiniDrv::drvDeviceCommand method in response to the application's call to the IWiaItem::DeviceCommand method (described in the Microsoft Windows SDK documentation). The IWiaMiniDrv::drvDeviceCommand method should perform the following tasks:

  1. 判斷傳送的指令是否為支援的指令。

  2. 處理命令要求。

The WIA driver should determine the WIA item that is to receive the device command by using the pWiasContext pointer. 然後,WIA 驅動程式應該處理以傳入 WIA 專案為目標的接收裝置命令。 傳送至不支援之 WIA 驅動程式的任何命令都應該失敗,並顯示E_INVALIDARG錯誤碼。

For an example implementation of the IWiaMiniDrv::drvDeviceCommand method, see Informing an Application of Item Tree Changes.