![]() You cannot use SetPrinter to change the default printer. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation factors that are difficult to predict when writing an application. This is a blocking or synchronous function and might not return immediately. If Level is 7 and the update action failed, SetPrinter returns ERROR_FILE_NOT_FOUND. If Level is 7 and the publish action failed, SetPrinter returns ERROR_IO_PENDING and attempts to complete the action in the background. If the function fails, the return value is zero. If the function succeeds, the return value is a nonzero value. Set the pPrinter parameter to a pointer to a DWORD value that specifies the new printer status. If the Level parameter is zero, set the value of this parameter to one of the following values. In this case, the printer retains its current state and the function reconfigures the printer data as specified by the Level and pPrinter parameters. If the Level parameter is nonzero, set the value of this parameter to zero. The dwAction member of this structure indicates whether SetPrinter should publish, unpublish, re-publish, or update the printer's data in the directory service.Ī PRINTER_INFO_8 structure specifying the global default printer settings.Ī PRINTER_INFO_9 structure specifying the per-user default printer settings. If Level is 0, but the Command parameter is not PRINTER_CONTROL_SET_STATUS, pPrinter must be NULL.Ī PRINTER_INFO_2 structure containing detailed information about the printer.Ī PRINTER_INFO_3 structure containing the printer's security information.Ī PRINTER_INFO_4 structure containing minimal printer information, including the name of the printer, the name of the server, and whether the printer is remote or local.Ī PRINTER_INFO_5 structure containing printer information such as printer attributes and time-out settings.Ī PRINTER_INFO_6 structure specifying the status value of a printer.Ī PRINTER_INFO_7 structure. Note that PRINTER_STATUS_PAUSED and PRINTER_STATUS_PENDING_DELETION are not valid status values to set. For a list of the possible status values, see the Status member of the PRINTER_INFO_2 structure. ![]() If the Command parameter is PRINTER_CONTROL_SET_STATUS, pPrinter must contain a DWORD value that specifies the new printer status to set. The type of data in the buffer is determined by the value of Level. ![]() This value can be 0, 2, 3, 4, 5, 6, 7, 8, or 9.Ī pointer to a buffer containing data to set for the printer, or containing information for the command specified by the Command parameter. If the Command parameter is not equal to zero, the Level parameter must be zero. The type of data that the function stores into the buffer pointed to by pPrinter. Use the OpenPrinter, OpenPrinter2, or AddPrinter function to retrieve a printer handle. Syntax BOOL SetPrinter(Ī handle to the printer. ![]() The SetPrinter function sets the data for a specified printer or sets the state of the specified printer by pausing printing, resuming printing, or clearing all print jobs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |