📄 wiadef.h
字号:
#pragma option push -b -a8 -pc -A- /*P_O_Push*/
/******************************************************************************
*
* (C) COPYRIGHT MICROSOFT CORP., 1998-1999
*
* TITLE: wiadef.h
*
* VERSION: 2.0
*
* DATE: 27 July, 1999
*
* DESCRIPTION:
* Header file used to define WIA constants and globals.
*
******************************************************************************/
//
// BUGBUG: Include our local copy of the GDI+ Image Guids : only temporary and
// must be removed as soon as GDI+ is in SDK
//
#include "imgguids.h"
/**************************************************************************
*
*
*
* WIA Errors
*
*
*
***************************************************************************/
//
// Define the facility code. Move this to sdk\inc???
//
#define FACILITY_WIA 33
//
// Definitions for WIA_ERRORs. Applications can test for these errors
// on API return, to keep users informed of conditions which a user
// could correct.
//
#define BASE_VAL_WIA_ERROR 0x00000000
#define WIA_ERROR_GENERAL_ERROR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 1))
#define WIA_ERROR_PAPER_JAM MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 2))
#define WIA_ERROR_PAPER_EMPTY MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 3))
#define WIA_ERROR_PAPER_PROBLEM MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 4))
#define WIA_ERROR_OFFLINE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 5))
#define WIA_ERROR_BUSY MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 6))
#define WIA_ERROR_WARMING_UP MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 7))
#define WIA_ERROR_USER_INTERVENTION MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 8))
#define WIA_ERROR_ITEM_DELETED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 9))
#define WIA_ERROR_DEVICE_COMMUNICATION MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 10))
#define WIA_ERROR_INVALID_COMMAND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 11))
//
// SelectDeviceDlg & GetImageDlg flags
//
#define WIA_SELECT_DEVICE_NODEFAULT 0x00000001
//
// GetImageDlg & DeviceDlg flags
//
#define WIA_DEVICE_DIALOG_SINGLE_IMAGE 0x00000002
//**************************************************************************
//
//
//
// WIA Events
//
//
//
//**************************************************************************
//
// Event registration flags, used by RegisterEventLaunch,
// RegisterEventCallbackInterface and RegisterEventCallbackCLSID.
//
#define WIA_REGISTER_EVENT_CALLBACK 0x00000001
#define WIA_UNREGISTER_EVENT_CALLBACK 0x00000002
#define WIA_SET_DEFAULT_HANDLER 0x00000004
//
// Event type : individual bits of the possible event type combinations
//
#define WIA_NOTIFICATION_EVENT 0x00000001
#define WIA_ACTION_EVENT 0x00000002
//
// Flag to indicate the corresponding persistent handler is default
//
#define WIA_IS_DEFAULT_HANDLER 0x00000001
// {143E4E83-6497-11d2-A231-00C04FA31809}
DEFINE_GUID(WIA_EVENT_DEVICE_DISCONNECTED, 0x143e4e83, 0x6497, 0x11d2, 0xa2, 0x31, 0x0, 0xc0, 0x4f, 0xa3, 0x18, 0x9);
// {A28BBADE-64B6-11d2-A231-00C04FA31809}
DEFINE_GUID(WIA_EVENT_DEVICE_CONNECTED, 0xa28bbade, 0x64b6, 0x11d2, 0xa2, 0x31, 0x0, 0xc0, 0x4f, 0xa3, 0x18, 0x9);
// 1d22a559-e14f-11d2-b326-00c04f68ce61
DEFINE_GUID(WIA_EVENT_ITEM_DELETED, 0x1d22a559, 0xe14f, 0x11d2, 0xb3, 0x26, 0x00, 0xc0, 0x4f, 0x68, 0xce, 0x61);
// 4c8f4ef5-e14f-11d2-b326-00c04f68ce61
DEFINE_GUID(WIA_EVENT_ITEM_CREATED, 0x4c8f4ef5, 0xe14f, 0x11d2, 0xb3, 0x26, 0x00, 0xc0, 0x4f, 0x68, 0xce, 0x61);
// {9638bbfd-d1bd-11d2-b31f-00c04f68ce61}
DEFINE_GUID(WIA_EVENT_VOLUME_INSERT, 0x9638bbfd, 0xd1bd, 0x11d2, 0xb3, 0x1f, 0x00, 0xc0, 0x4f, 0x68, 0xce, 0x61);
//**************************************************************************
//
//
//
// WIA Commands
//
//
//
//**************************************************************************
// 9b26b7b2-acad-11d2-a093-00c04f72dc3c
DEFINE_GUID(WIA_CMD_SYNCHRONIZE, 0x9b26b7b2, 0xacad, 0x11d2, 0xa0, 0x93, 0x00, 0xc0, 0x4f, 0x72, 0xdc, 0x3c);
// af933cac-acad-11d2-a093-00c04f72dc3c
DEFINE_GUID(WIA_CMD_TAKE_PICTURE, 0xaf933cac, 0xacad, 0x11d2, 0xa0, 0x93, 0x00, 0xc0, 0x4f, 0x72, 0xdc, 0x3c);
// e208c170-acad-11d2-a093-00c04f72dc3c
DEFINE_GUID(WIA_CMD_DELETE_ALL_ITEMS, 0xe208c170, 0xacad, 0x11d2, 0xa0, 0x93, 0x00, 0xc0, 0x4f, 0x72, 0xdc, 0x3c);
// 04e725b0-acae-11d2-a093-00c04f72dc3c
DEFINE_GUID(WIA_CMD_CHANGE_DOCUMENT, 0x04e725b0, 0xacae, 0x11d2, 0xa0, 0x93, 0x00, 0xc0, 0x4f, 0x72, 0xdc, 0x3c);
// 1f3b3d8e-acae-11d2-a093-00c04f72dc3c
DEFINE_GUID(WIA_CMD_UNLOAD_DOCUMENT, 0x1f3b3d8e, 0xacae, 0x11d2, 0xa0, 0x93, 0x00, 0xc0, 0x4f, 0x72, 0xdc, 0x3c);
// The following are private commands for debugging use only.
// 73815942-dbea-11d2-8416-00c04fa36145
DEFINE_GUID(WIA_CMD_DELETE_DEVICE_TREE, 0x73815942, 0xdbea, 0x11d2, 0x84, 0x16, 0x00, 0xc0, 0x4f, 0xa3, 0x61, 0x45);
// 9cba5ce0-dbea-11d2-8416-00c04fa36145
DEFINE_GUID(WIA_CMD_BUILD_DEVICE_TREE, 0x9cba5ce0, 0xdbea, 0x11d2, 0x84, 0x16, 0x00, 0xc0, 0x4f, 0xa3, 0x61, 0x45);
//**************************************************************************
//
//
// WIA Icons
//
// Event : -1000 to -1499 (Standard), -1500 to -1999 (Custom)
// Command : -2000 to -2499 (Standard), -2500 to -2999 (Custom)
//
//**************************************************************************
#define WIA_ICON_DEVICE_DISCONNECTED (L"sti.dll,-1000")
#define WIA_ICON_DEVICE_CONNECTED (L"sti.dll,-1001")
#define WIA_ICON_ITEM_DELETED (L"sti.dll,-1002")
#define WIA_ICON_ITEM_CREATED (L"sti.dll,-1003")
#define WIA_ICON_VOLUME_INSERT (L"sti.dll,-1004")
#define WIA_ICON_SYNCHRONIZE (L"sti.dll,-2000")
#define WIA_ICON_TAKE_PICTURE (L"sti.dll,-2001")
#define WIA_ICON_DELETE_ALL_ITEMS (L"sti.dll,-2002")
#define WIA_ICON_CHANGE_DOCUMENT (L"sti.dll,-2003")
#define WIA_ICON_UNLOAD_DOCUMENT (L"sti.dll,-2004")
#define WIA_ICON_DELETE_DEVICE_TREE (L"sti.dll,-2005")
#define WIA_ICON_BUILD_DEVICE_TREE (L"sti.dll,-2006")
//**************************************************************************
//
//
//
// WIA Callbacks
//
//
//
//**************************************************************************
//
//
// IImageTransfer TYMED
//
// IImageTransfer constant, should be added to objidl.idl ???:
//
#define TYMED_CALLBACK 128
//
// IImageTransfer Callback Status. Messages must be a
// single value
//
#define IT_MSG_DATA_HEADER 0x0001
#define IT_MSG_DATA 0x0002
#define IT_MSG_STATUS 0x0003
#define IT_MSG_TERMINATION 0x0004
#define IT_MSG_NEW_PAGE 0x0005
//
// Flags may be bit field combinations
//
#define IT_STATUS_TRANSFER_FROM_DEVICE 0x0001
#define IT_STATUS_PROCESSING_DATA 0x0002
#define IT_STATUS_TRANSFER_TO_CLIENT 0x0004
//
// IWIAEventCallback codes
//
#define WIA_MAJOR_EVENT_DEVICE_CONNECT 0x01
#define WIA_MAJOR_EVENT_DEVICE_DISCONNECT 0x02
#define WIA_MAJOR_EVENT_PICTURE_TAKEN 0x03
#define WIA_MAJOR_EVENT_PICTURE_DELETED 0x04
//
// device connection status
//
#define WIA_DEVICE_NOT_CONNECTED 0
#define WIA_DEVICE_CONNECTED 1
//**************************************************************************
//
//
//
// WIA Enumeration Flags
//
//
//
//**************************************************************************
//
// EnumDeviceCapabilities flags
//
#define WIA_DEVICE_COMMANDS 1
#define WIA_DEVICE_EVENTS 2
//
// EnumDeviceInfo Flags
//
#define WIA_DEVINFO_ENUM_LOCAL 0x00000010
//**************************************************************************
//
//
//
// WIA Item constants
//
//
//
//**************************************************************************
//
// Item Types
//
#define WiaItemTypeFree 0x00000000
#define WiaItemTypeImage 0x00000001
#define WiaItemTypeFile 0x00000002
#define WiaItemTypeFolder 0x00000004
#define WiaItemTypeRoot 0x00000008
#define WiaItemTypeAnalyze 0x00000010
#define WiaItemTypeAudio 0x00000020
#define WiaItemTypeDevice 0x00000040
#define WiaItemTypeDeleted 0x00000080
#define WiaItemTypeDisconnected 0x00000100
#define WiaItemTypeMask 0x000001FF
//
// big max device specific item context, may want smaller
//
#define WIA_MAX_CTX_SIZE 0x01000000
//**************************************************************************
//
//
//
// WIA Properties
//
//
//
//**************************************************************************
/*******************************************************************************
//
// WIA_PROPERTY_INFO
//
// This information is available for every WIA property
//
// Elements
//
// lSize - size of this structure
// lAccessFlags - r/w access of property
// vt - vartype of property
// lInfoType - info for prop values (none,range,array)
// Nom - Nominal(default) value
// Min - range min
// Max - range max
// Inc - range increment
// cNumList - number of elements in list
// pList - pointer to list of elements
//
//*******************************************************************************/
#define WIA_PROP_READ 0x01
#define WIA_PROP_WRITE 0x02
#define WIA_PROP_RW WIA_PROP_READ | WIA_PROP_WRITE
#define WIA_PROP_SYNC_REQUIRED 0x04
#define WIA_PROP_NONE 0x08
#define WIA_PROP_RANGE 0x10
#define WIA_PROP_LIST 0x20
#define WIA_PROP_FLAG 0x40
#define WIA_PROP_CACHEABLE 0x10000
//
// Specify that the item can be deleted from the device
//
#define WIA_ITEM_CAN_BE_DELETED 0x80
#define WIA_ITEM_READ WIA_PROP_READ
#define WIA_ITEM_WRITE WIA_PROP_WRITE
#define WIA_ITEM_RD (WIA_ITEM_READ | WIA_ITEM_CAN_BE_DELETED)
#define WIA_ITEM_RWD (WIA_ITEM_READ | WIA_ITEM_WRITE | WIA_ITEM_CAN_BE_DELETED)
#ifndef __WIAPROP_H_INCLUDED
#define __WIAPROP_H_INCLUDED
//
// Device Information Property ID constants. Device information properties
// are present on all WIA devices. These property values are stored in the
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -