-1

I need to print documents in a specific order. To do that,i use shellExecute api to print documents.

Some documents may be quicker to print , so i have to wait for the document to be in the spooler before calling another shellExecute.

For that, i use FindFirstPrinterChangeNotification, waitForSingleObject and FindNextPrinterChangeNotification.

It works fine. But if the application started by shellExecute is already open, it's possible that it prints on another printer that the windows default printer. (if default printer has been changed )

I could watch all printers, but, i'd prefer to know wich printer uses the started process and watch this printer.

With shellExecuteEx, i can get a handle to the process started by this api.

So, is there a way to know the printer used by default by a process ?

Arsnow
  • 161
  • 1
  • 13
  • What is the application we are talking about? Maybe there are other options? – whosrdaddy Oct 03 '14 at 11:29
  • well, i don't know in advance the application. It can be any application associated with the document type. Usually, it's pdf reader, ms word ans ms excel, but it can be anything else – Arsnow Oct 13 '14 at 06:58

1 Answers1

0

So, is there a way to know the printer used by default by a process?

No there is not. Programs are entitled to use whatever logic they choose to determine their default printer. So in general, you've no way to ask a process which printer it will use, without having more specific knowledge of the process in question.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490