📄 winddiui.h
字号:
//
// PRINTER_EVENT_DELETE_CONNECTION
// return value ignored
// Called Before DeletePrinterConnect API
// in the context of the calling app
// lParam NULL
//
// PRINTER_EVENT_INITIALIZE
// Called when a printer is created for the driver to
// initialize its registry settings
// Called in the spooler process
// lParam NULL
//
// PRINTER_EVENT_DELETE
// Called when a printer is about to be deleted
// Called in the spooler process
// lParam NULL
//
// PRINTER_EVENT_CACHE_REFRESH
// return value ignored
// called in spooler process
// No UI
// called when spooler detects that something has
// changed in the workstaion cache or when establishing
// the cache.
// allows driver to update any private cache data
// ( such as font files etc. )
//
// PRINTER_EVENT_CACHE_DELETE
// return value ignored
// called in spooler process
// No UI
// called when spooler is deleting a cached printer
// allows printer driver to delete anything it has
// cached
//
// PRINTER_EVENT_ATTRIBUTES_CHANGED
// return value ignored
// No UI
// Called when the printer attribute bits for a given
// printer have changed. Allows the driver to respond
// appropriately.
// lParam is a pointer to a PRINTER_EVENT_ATTRIBUTES_INFO
// structure.
//
// PRINTER_EVENT_FLAG_NO_UI
// Do not bring up UI when this flag it ON
//
//
// DrvPrinterEvent DriverEvent code
//
#define PRINTER_EVENT_CONFIGURATION_CHANGE 0
#define PRINTER_EVENT_ADD_CONNECTION 1
#define PRINTER_EVENT_DELETE_CONNECTION 2
#define PRINTER_EVENT_INITIALIZE 3
#define PRINTER_EVENT_DELETE 4
#define PRINTER_EVENT_CACHE_REFRESH 5
#define PRINTER_EVENT_CACHE_DELETE 6
#define PRINTER_EVENT_ATTRIBUTES_CHANGED 7
//
// DrvPrinterEvent Flags
//
#define PRINTER_EVENT_FLAG_NO_UI 0x00000001
//
// lParam of PRINTER_EVENT_ATTRIBUTES_CHANGED points to this structure.
//
typedef struct _PRINTER_EVENT_ATTRIBUTES_INFO {
DWORD cbSize;
DWORD dwOldAttributes;
DWORD dwNewAttributes;
} PRINTER_EVENT_ATTRIBUTES_INFO, *PPRINTER_EVENT_ATTRIBUTES_INFO;
BOOL WINAPI
DrvPrinterEvent(
LPWSTR pPrinterName,
int DriverEvent,
DWORD Flags,
LPARAM lParam
);
//
// DrvDriverEvent is called when any version of the printer driver is deleted.
//
#define DRIVER_EVENT_INITIALIZE 0x00000001
#define DRIVER_EVENT_DELETE 0x00000002
BOOL WINAPI
DrvDriverEvent(
DWORD dwDriverEvent,
DWORD dwLevel,
LPBYTE pDriverInfo,
LPARAM lParam
);
// Print processor capabilities for the driver.
#define BORDER_PRINT 0x00000000 // default
#define NO_BORDER_PRINT 0x00000001
#define BOOKLET_PRINT 0x00000002
#define NO_COLOR_OPTIMIZATION 0x00000000 // default
#define COLOR_OPTIMIZATION 0x00000001
typedef struct _ATTRIBUTE_INFO_1 {
DWORD dwJobNumberOfPagesPerSide;
DWORD dwDrvNumberOfPagesPerSide;
DWORD dwNupBorderFlags;
DWORD dwJobPageOrderFlags;
DWORD dwDrvPageOrderFlags;
DWORD dwJobNumberOfCopies;
DWORD dwDrvNumberOfCopies;
} ATTRIBUTE_INFO_1, *PATTRIBUTE_INFO_1;
typedef struct _ATTRIBUTE_INFO_2 {
DWORD dwJobNumberOfPagesPerSide;
DWORD dwDrvNumberOfPagesPerSide;
DWORD dwNupBorderFlags;
DWORD dwJobPageOrderFlags;
DWORD dwDrvPageOrderFlags;
DWORD dwJobNumberOfCopies;
DWORD dwDrvNumberOfCopies;
DWORD dwColorOptimization; // Added for monochrome optimization
} ATTRIBUTE_INFO_2, *PATTRIBUTE_INFO_2;
typedef struct _ATTRIBUTE_INFO_3 {
DWORD dwJobNumberOfPagesPerSide;
DWORD dwDrvNumberOfPagesPerSide;
DWORD dwNupBorderFlags;
DWORD dwJobPageOrderFlags;
DWORD dwDrvPageOrderFlags;
DWORD dwJobNumberOfCopies;
DWORD dwDrvNumberOfCopies;
DWORD dwColorOptimization; // Added for monochrome optimization
short dmPrintQuality; // Added for monochrome optimization
short dmYResolution; // Added for monochrome optimization
} ATTRIBUTE_INFO_3, *PATTRIBUTE_INFO_3;
//
// DrvQueryJobAttributes is called by the spooler(print processor) to get information
// about the printing options used with the job. These options include N-up and reverse
// order printing.
//
BOOL WINAPI
DrvQueryJobAttributes(
HANDLE hPrinter,
PDEVMODE pDevMode,
DWORD dwLevel,
LPBYTE lpAttributeInfo
);
//
// DrvQueryColorProfile is called by the GDI (graphics device interface) to get information
// about the default color profile for the given DEVMODE, used with ICM (image color
// management).
//
BOOL WINAPI
DrvQueryColorProfile(
HANDLE hPrinter,
PDEVMODEW pdevmode,
ULONG ulQueryMode,
VOID *pvProfileData,
ULONG *pcbProfileData,
FLONG *pflProfileData
);
// The value for ulQueryMode
#define QCP_DEVICEPROFILE 0x0000
#define QCP_SOURCEPROFILE 0x0001
// The flags for pflProfileData.
#define QCP_PROFILEMEMORY 0x0001 // The pvProfileData points the color profile data itself.
#define QCP_PROFILEDISK 0x0002 // The pvProfileData points the color profile file name in Unicode.
//
// User Mode Printer Driver DLL,
//
// Note on hPrinter passed into DrvSplStartDoc() and subsequent
// DrvSplxxx calls
//
//
// A. If you have DrvSplxxxx calls in separate DLL and link it with
// spoolss.lib.
//
// * The hPrinter will be valid for any call to the spooler, such as
// WritePrinter(), GetPrinterData()
//
// * To do this you must
//
// 1. Have separate DLL for all DrvSplxxx functions.
// 2. Put this DLL name into your dependency files (inf).
// 3. link to spoolss.lib rather than winspool.lib
// 4. Use SetPrinterData() with SPLPRINTER_USER_MODE_PRINTER_DRIVER
// as key name, and this DLL name as data.
// 5. Call any spooler functions linked from spoolss.lib
//
//
//
// B. If you have DrvSplxxx calls located in your printer driver UI DLL and
// linked with winspool.lib
//
// * The hPrinter is NOT valid for any spooler calls, such as
// WritePrinter(), GetPrinterData() from within the DrvSplxxx driver
// functions.
//
// * To do any spooler call from inside of DrvSplxxxx function you must
// do the following
//
// 1. hSpoolSS = LoadLibrary("spoolss.dll");
// 2. pfn = GetProcAddress("WritePrinter") or whatever the spooler
// functions you wish to call
// 3. Call the pfn function pointer returned from GetProcAddress()
// 4. FreeLibrary(hSpoolSS);
//
//
// The A method is recommended.
//
//
// If a UserModePrinterDriver DLL is created the following routines are
// required or optional
//
// Required Routines
// DrvSplStartDoc
// DrvSplWritePrinter
// DrvSplEndDoc
// DrvSplClose
//
//
// Optional Routines
// DrvSplStart
// DrvSplEndPage
// DrvSplAbort
//
//
HANDLE WINAPI
DrvSplStartDoc(
HANDLE hPrinter,
DWORD JobId
);
BOOL WINAPI
DrvSplWritePrinter(
HANDLE hDriver,
LPVOID pBuf,
DWORD cbBuf,
LPDWORD pcWritten
);
VOID WINAPI
DrvSplEndDoc(
HANDLE hDriver
);
VOID WINAPI
DrvSplClose(
HANDLE hDriver
);
BOOL WINAPI
DrvSplStartPage(
HANDLE hDriver
);
BOOL WINAPI
DrvSplEndPage(
HANDLE hDriver
);
VOID WINAPI
DrvSplAbort(
HANDLE hDriver
);
//
// Printer Attribute
// Use with SetPrinterData to define UMPD.DLL
//
#define SPLPRINTER_USER_MODE_PRINTER_DRIVER TEXT("SPLUserModePrinterDriver")
#ifdef __cplusplus
}
#endif
#endif /* !_WINDDIUI_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -