vendredi 30 mars 2012 08:32
Is there any way to determine inside V3 driver code what type of application (Metro-style or Desktop) is printing when our driver is invoked?
Particularly we need this information inside our implementation of IPrintOemUI2::DocumentEvent for the DOCUMENTEVENT_STARTDOCPOST event.
We need to implement different logic depending on the type of application that is printing.
Toutes les réponses
samedi 31 mars 2012 06:34Modérateur
I will look into this for you.
Best Wishes - Eric
mardi 17 avril 2012 11:58
It seems we have found a solution - when in DocumentEvent handler we call GetJob to get the JOB_INFO_1 structure for the current job.
If data type of print job specified in JOB_INFO_1.pDatatype == "XPS2GDI" then we assume the printing is from Metro application, otherwise - it is from non-Metro application.
This logic seems to have worked so far.
mardi 17 avril 2012 17:20
Can you please expand on your scenario? Why do you need to know what kind of app is printing?
mardi 17 avril 2012 17:37
You should not take any dependencies on the "XPS2GDI" datatype. That datatype is for internal use only and we reserve the right to change our implementation in this space in the future.
mercredi 18 avril 2012 03:56
When printing we launch our post-processing application that allows user to alter print job before sending it to printer, without the need to change the original document. This post-processing application shows UI in desktop mode, so opening it for Metro-style applications is not appropriate.
jeudi 19 avril 2012 01:52
I agree that scenario wouldn't be great for Metro style apps. Unfortunately, we don't have a supported mechanism to determine if the printing app is Metro style or not. We will try to get users to your custom print UI on the desktop after they have printed.