网站首页  词典首页

请输入您要查询的函数:

 

术语 getprinterdriver
释义 GetPrinterDriver
语法:
BOOL GetPrinterDriver(
__in HANDLE hPrinter,
__in LPTSTR pEnvironment,
__in DWORD Level,
__out LPBYTE pDriverInfo,
__in DWORD cbBuf,
__out LPDWORD pcbNeeded
);
GetPrinterDriver功能
该GetPrinterDriver函数检索指定的打印机驱动程序的数据。如果驱动程序不在本地计算机上安装,GetPrinterDriver安装它。
参数
hPrinter [in]
一个句柄,的,司机应该检索数据的打印机。使用OpenPrinter或添加打印机函数检索打印机处理。
pEnvironment [in]
一个指向 null 结尾的字符串指针,指定环境(例如,Windows x86的时,Windows IA64的,或Windows x64)的。如果该参数为NULL,则调用应用程序和客户机(不是目标应用程序和打印服务器)是目前使用的环境。
Level [in]
打印机驱动程序结构的pDriverInfo缓冲区内。此参数可以是下列值之一。
ValueMeaning
1DRIVER_INFO_1
2DRIVER_INFO_2
3DRIVER_INFO_3
4DRIVER_INFO_4
5DRIVER_INFO_5
6DRIVER_INFO_6
pDriverInfo [out]
A到接收缓冲区结构包含有关该驱动程序,如级别指定的指针。该缓冲区必须足够大,存储字符串指向的结构的成员。
要确定所需的缓冲区大小设置为0 cbBuf,呼吁GetPrinterDriver。 GetPrinterDriver失败,GetLastError返回ERROR_INSUFFICIENT_BUFFER和pcbNeeded参数返回的大小,以字节为单位须持有的结构及其数据数组中的缓冲区。
cbBuf [in]
大小,以字节数组的会上pDriverInfo点。
pcbNeeded [out]
一个值,接收复制的字节数,如果函数调用成功或所需的字节数指针,如果cbBuf太小。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零。
对于一个不存在的驱动程序,函数返回ERROR_UNKNOWN_PRINTER_DRIVER。
备注
该DRIVER_INFO_2,DRIVER_INFO_3,DRIVER_INFO_4,DRIVER_INFO_5和DRIVER_INFO_6结构包含文件名或完整路径和文件在pDriverPath成员的打印机驱动程序的名称。应用程序可以使用路径和文件名加载通过调用LoadLibrary函数和提供的路径和文件作为单个参数名称的打印机驱动程序。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesGetPrinterDriverW(Unicode)和GetPrinterDriverA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
AddPrinterDriver
DRIVER_INFO_1
DRIVER_INFO_2
DRIVER_INFO_3
DRIVER_INFO_4
DRIVER_INFO_5
DRIVER_INFO_6
EnumPrinterDrivers
OpenPrinter
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetPrinterDriver Function
The GetPrinterDriver function retrieves driver data for the specified printer. If the driver is not installed on the local computer, GetPrinterDriver installs it.
Syntax
BOOL GetPrinterDriver(
__in HANDLE hPrinter,
__in LPTSTR pEnvironment,
__in DWORD Level,
__out LPBYTE pDriverInfo,
__in DWORD cbBuf,
__out LPDWORD pcbNeeded
);
Parameters
hPrinter [in]
A handle to the printer for which the driver data should be retrieved. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.
pEnvironment [in]
A pointer to a null-terminated string that specifies the environment (for example, Windows x86, Windows IA64, or Windows x64). If this parameter is NULL, the current environment of the calling application and client machine (not of the destination application and print server) is used.
Level [in]
The printer driver structure returned in the pDriverInfo buffer. This parameter can be one of the following values.
ValueMeaning
1DRIVER_INFO_1
2DRIVER_INFO_2
3DRIVER_INFO_3
4DRIVER_INFO_4
5DRIVER_INFO_5
6DRIVER_INFO_6

pDriverInfo [out]
A pointer to a buffer that receives a structure containing information about the driver, as specified by Level. The buffer must be large enough to store the strings pointed to by the structure members.
To determine the required buffer size, call GetPrinterDriver with cbBuf set to zero. GetPrinterDriver fails, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and the pcbNeeded parameter returns the size, in bytes, of the buffer required to hold the array of structures and their data.
cbBuf [in]
The size, in bytes, of the array at which pDriverInfo points.
pcbNeeded [out]
A pointer to a value that receives the number of bytes copied if the function succeeds or the number of bytes required if cbBuf is too small.
Return Value
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero.
For a non-existent driver, the function returns ERROR_UNKNOWN_PRINTER_DRIVER.
Remarks
The DRIVER_INFO_2, DRIVER_INFO_3, DRIVER_INFO_4, DRIVER_INFO_5, and DRIVER_INFO_6 structures contain the file name or the full path and file name of the printer driver in the pDriverPath member. An application can use the path and file name to load a printer driver by calling the LoadLibrary function and supplying the path and file name as the single argument.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesGetPrinterDriverW (Unicode) and GetPrinterDriverA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
AddPrinterDriver
DRIVER_INFO_1
DRIVER_INFO_2
DRIVER_INFO_3
DRIVER_INFO_4
DRIVER_INFO_5
DRIVER_INFO_6
EnumPrinterDrivers
OpenPrinter
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144914(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:16:10