SHInvokePrinterCommandSHInvokePrinterCommand*
*



Contents  *



Index  *Topic Contents
*Previous Topic: SHGetSpecialFolderPath
*Next Topic: SHLoadInProc

SHInvokePrinterCommand


BOOL SHInvokePrinterCommand(
    HWND hwnd,
    UINT uAction,
    LPCTSTR lpBuf1,
    LPCTSTR lpBuf2,
    BOOL fModal
);

Executes a command on a printer object.

hwnd
Handle of the window that will be used as the parent of any windows or dialog boxes that are created during the operation.
uAction
A value that determines the type of printer operation that will be performed. This can be one of the following values:
PRINTACTION_DOCUMENTDEFAULTS Windows NT® only. The default document properties for the printer specified by the name in lpBuf1 will be displayed. lpBuf2 is ignored.
PRINTACTION_NETINSTALL The network printer specified by the name in lpBuf1 will be installed. lpBuf2 is ignored.
PRINTACTION_NETINSTALLLINK A shortcut to the network printer specified by the name in lpBuf1 will be created. lpBuf2 specifies the drive and path of the folder in which the shortcut will be created. The network printer must have already been installed on the local machine.
PRINTACTION_OPEN The printer specified by the name in lpBuf1 will be opened. lpBuf2 is ignored.
PRINTACTION_OPENNETPRN The network printer specified by the name in lpBuf1 will be opened. lpBuf2 is ignored.
PRINTACTION_PROPERTIES The properties for the printer specified by the name in lpBuf1 will be displayed. lpBuf2 can either be NULL or specify.
PRINTACTION_SERVERPROPERTIES Windows NT® only. The properties for the server of the printer specified by the name in lpBuf1 will be displayed. lpBuf2 is ignored.
PRINTACTION_TESTPAGE A test page will be printed on the printer specified by the name in lpBuf1. lpBuf2 is ignored.
lpBuf1
Address of a string that contains additional information for the printer command. The information contained in this parameter depends upon the value of uAction.
lpBuf2
Address of a string that contains additional information for the printer command. The information contained in this parameter depends upon the value of uAction.
fModal
A value that determines whether SHInvokePrinterCommand should return after initializing the command or wait until the command is completed. If this value is non-zero, SHInvokePrinterCommand will not return until the command is completed. If this value is zero, SHInvokePrinterCommand will return as soon as the command is initialized.

When a printer name is specified by lpBuf1, the name can either be the name of a local printer or the server and share name of a network printer. When specifying a network printer name, the name must be specified in the format of "\\<server>\<shared printer name>".

This function is implemented in shell versions 4.71 and later. In order to maintain backward compatibility with previous shell versions, this function should not be used explicitly. Instead, the LoadLibrary and GetProcAddress functions should be used to obtain the function address.

Version 4.71


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.