网站首页  词典首页

请输入您要查询的函数:

 

术语 addprinterconnection
释义 AddPrinterConnection
语法:
BOOL AddPrinterConnection(
__in LPTSTR pName
);
AddPrinterConnection功能
该AddPrinterConnection函数将连接到当前用户指定的打印机。
参数
pName [in]
一个指向 null 结尾的字符串指针,指定了打印机的当前用户希望建立一个连接的名称。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零。
备注
当Windows成为一个连接到一台打印机,它可能需要复制打印机驱动程序文件到该打印机连接服务器。如果用户没有权限的文件复制到适当的位置,AddPrinterConnection函数失败,GetLastError返回ERROR_ACCESS_DENIED。
打印机连接调用AddPrinterConnection将被枚举时EnumPrinters是设置为PRINTER_ENUM_CONNECTION却提示要求成立。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesAddPrinterConnectionW(Unicode)和AddPrinterConnectionA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
ConnectToPrinterDlg
DeletePrinterConnection
EnumPrinters
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==AddPrinterConnection Function
The AddPrinterConnection function adds a connection to the specified printer for the current user.
Syntax
BOOL AddPrinterConnection(
__in LPTSTR pName
);
Parameters
pName [in]
A pointer to a null-terminated string that specifies the name of a printer to which the current user wishes to establish a connection.
Return Value
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero.
Remarks
When Windows makes a connection to a printer, it may need to copy printer driver files to the server to which the printer is attached. If the user does not have permission to copy files to the appropriate location, the AddPrinterConnection function fails, and GetLastError returns ERROR_ACCESS_DENIED.
A printer connection established by calling AddPrinterConnection will be enumerated when EnumPrinters is called with dwType set to PRINTER_ENUM_CONNECTION.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesAddPrinterConnectionW (Unicode) and AddPrinterConnectionA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
ConnectToPrinterDlg
DeletePrinterConnection
EnumPrinters
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd183344(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 11:24:01