![]() ![]() ![]() Rundll32 printui. You may also want to install your printer computer wide (for all users) using printui.dll, eg,: If the service must print using the credentials of one or more users defined at run time, then the service must call LogonUser(), LoadUserProfile(), and ImpersonateLoggedOnUser() before printing. Because the size of the required buffer cannot be known in advance, the EnumPrinters is called two times. The following code example shows how to call EnumPrinters and get the names of the local and locally connected printers. If all the print jobs can be sent with one user's credentials, the service can be run under that user's account and will have access to the printers that are known to that user on that computer. Curiously, though there are API functions AddPrintProvidor() and DeletePrintProvidor(), there is no EnumPrintProvidors() instead one must use EnumPrinters(). You can obtain the exact printer name string to pass to CreateDC by calling the EnumPrinters function. There are some considerations when printing from Windows services, however. Try to run it in the context of a user who has a printer installed:Ī Windows service that is designed to print can use the Win32 GDI APIs to print documents to a printer. ![]() printerinfo-updated. You're probably running the service in different user context than when run interactively (as a 'normal app'). zip file contains three example procedures, as follows: printerinfo.p : The original code that went with this article.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |