We need to be able to change the selected default print tray for this printer. Does anyone have VC ++ / win32 code for this?
In case that matters, I believe that we should change the default setting for the printer. Our print jobs are performed by an application other than ours, so we cannot make such changes in the context of the print operation originating from our application. If there is any way to change the default print settings in another application, I think we are stuck by changing the default user settings for the printer, initiating our print job, and then setting the default values to the original values.
We would prefer that the default changes change only for the current user and do not require any special increase in UAC, etc.
I suspect that he will use something similar to what is shown in this MSDN article and includes setting fields in the DEVMODE structure (either dmDefaultSource or dmFormName or both).
Any takers? Or does anyone have any mistakes that they would like to share?
EDIT: Here is a link to the DEVMODE documentation DEVMODE documentation
EDIT: I should also indicate that we are looking for a general solution, not something specific for a particular printer (we are deploying in many, many environments)
source
share