none
Is it possible for metro apps to call APIs in the print spooler API of Win32 ?

    Pregunta

  • I would like to know whether metro apps can call APIs in the print spooler API of Win32 or not and how to get the informations such as installer printer drivers and printing jobs to be monitored.

    When i am testing on developer preview, test app with C++ can call the print spooler APIs such as OpenPrinter().

    But the spooler APIs are not listed up in APIs for Metro style apps (http://msdn.microsoft.com/en-us/library/windows/apps/br211369.aspx) so that I’m wondering the spooler API can be called by metro app or not.

    Also, Windows.Devices.Enumeration namespace (http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.enumeration.aspx) doesn't mentioned printing devices in the DeviceClass to be found. So I have doubt how to find out installed printer driver informations such as list of print name and the related information on Metro UI.

    If it's not possible to call spooler API by metro app, how to get the installed printer driver information and print job information via WinRT APIs?

    And how to search actual printers on the network via the same way like Windows 8 by using UPnP ?


    domingo, 29 de enero de 2012 10:41

Respuestas

  • Hi Daniel,

    No, you cannot call native Win32 APIs from a Metro app.

    Please see the Metro style device app sample we provided with Consumer Preview. It demonstrates how to enumerate print queues using the Windows.Devices.Enumeration namespace, and then how to obtain a PrinterExtensionContext object so you can make Bidi queries for status. http://code.msdn.microsoft.com/Printer-extension-app-44235a19

    We don't support managing print jobs from Metro style apps. This is only supported from desktop applications, or from the Microsoft provided Print Queue window. 

    We don't support discovery of unassociated network printers from Metro style apps, either. In many cases, where the network is sufficiently small and not a domain network, WSD printers will be automatically added, so no user action is required. Otherwise, users can use the Metro style control panel or the Devices and Printers folder to find and add new devices.

    Thanks!

    Justin

    miércoles, 14 de marzo de 2012 17:00

Todas las respuestas

  • Daniel,

    I will look into this for you.

    Best Wishes - Eric

    lunes, 12 de marzo de 2012 20:16
    Moderador
  • Hi Daniel,

    No, you cannot call native Win32 APIs from a Metro app.

    Please see the Metro style device app sample we provided with Consumer Preview. It demonstrates how to enumerate print queues using the Windows.Devices.Enumeration namespace, and then how to obtain a PrinterExtensionContext object so you can make Bidi queries for status. http://code.msdn.microsoft.com/Printer-extension-app-44235a19

    We don't support managing print jobs from Metro style apps. This is only supported from desktop applications, or from the Microsoft provided Print Queue window. 

    We don't support discovery of unassociated network printers from Metro style apps, either. In many cases, where the network is sufficiently small and not a domain network, WSD printers will be automatically added, so no user action is required. Otherwise, users can use the Metro style control panel or the Devices and Printers folder to find and add new devices.

    Thanks!

    Justin

    miércoles, 14 de marzo de 2012 17:00