Group: Printing and Print Spooler - Library: winspool.drv
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.
How to browse and connect to printers on a network (WinNT)
HANDLE ConnectToPrinterDlg(
HWND hwnd, // handle to parent window
DWORD Flags // reserved; must be zero
);
DECLARE INTEGER ConnectToPrinterDlg IN winspool.drv;
INTEGER hwnd,;
INTEGER Flags
hwnd [in] Specifies the parent window of the dialog box.
Flags [in] This parameter is reserved and must be zero.
If the function succeeds and the user selects a printer, the return value is a handle to the selected printer.
Windows NT/2000/XP: Included in Windows NT 3.5 and later.
Windows 95/98/Me: Unsupported.
An application should call DeletePrinter to delete a local printer. An application should call DeletePrinterConnection to delete a connection to a printer.