网站首页  词典首页

请输入您要查询的函数:

 

术语 connecttoprinterdlg
释义 ConnectToPrinterDlg
语法:
HANDLE ConnectToPrinterDlg(
__in HWND hwnd,
__in DWORD Flags
);
ConnectToPrinterDlg功能
该ConnectToPrinterDlg函数显示一个对话框,让用户浏览和连接到网络上的打印机。如果用户选择一台打印机,函数试图创建一个连接到它,如果合适的驱动程序没有安装在服务器上,用户是由于在当地建立一个打印机的选择。
参数
hwnd [in]
指定对话框的父窗口。
标志 [in]
这个参数是保留,必须为零。
返回值
如果函数成功,用户选择一个打印机,返回值是一个句柄到选定的打印机。
如果函数失败,或用户不取消选择打印机的对话框,返回值为NULL。
备注
该ConnectToPrinterDlg函数试图创建一个连接到选定的打印机。但是,如果服务器上的打印机所在没有合适的驱动程序,功能为用户提供了创建本地打印机的选择。调用应用程序可以判断函数创建了一个本地打印机通过调用一个PRINTER_INFO_2结构GetPrinter,然后检查该结构的属性成员。
应用程序应调用DeletePrinter删除本地打印机。应用程序应调用DeletePrinterConnection删除连接到打印机。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
AddPrinterConnection
ClosePrinter
DeletePrinter
DeletePrinterConnection
GetPrinter
PRINTER_INFO_2
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==ConnectToPrinterDlg Function
The ConnectToPrinterDlg function displays a dialog box that lets users browse and connect to printers on a network. If the user selects a printer, the function attempts to create a connection to it; if a suitable driver is not installed on the server, the user is given the option of creating a printer locally.
Syntax
HANDLE ConnectToPrinterDlg(
__in HWND hwnd,
__in DWORD Flags
);
Parameters
hwnd [in]
Specifies the parent window of the dialog box.
Flags [in]
This parameter is reserved and must be zero.
Return Value
If the function succeeds and the user selects a printer, the return value is a handle to the selected printer.
If the function fails, or the user cancels the dialog box without selecting a printer, the return value is NULL.
Remarks
The ConnectToPrinterDlg function attempts to create a connection to the selected printer. However, if the server on which the printer resides does not have a suitable driver installed, the function offers the user the option of creating a printer locally. A calling application can determine whether the function has created a printer locally by calling GetPrinter with a PRINTER_INFO_2 structure, then examining that structure's Attributes member.
An application should call DeletePrinter to delete a local printer. An application should call DeletePrinterConnection to delete a connection to a printer.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
AddPrinterConnection
ClosePrinter
DeletePrinter
DeletePrinterConnection
GetPrinter
PRINTER_INFO_2
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd183473(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:30:15