Reputation: 31
The below code opens a .pdf file in Windows 8 Microsoft Reader, but it does not print the document. This code is executed from Kindly let us know if printing cannot be done from command line for Reader.
SHELLEXECUTEINFO seInfo;
ZeroMemory(&seInfo, sizeof(seInfo));
seInfo.cbSize = sizeof(seInfo);
seInfo.fMask = SEE_MASK_NOCLOSEPROCESS|SEE_MASK_FLAG_DDEWAIT;
seInfo.lpDirectory = NULL;
seInfo.lpClass = NULL;
seInfo.lpIDList = NULL;
seInfo.nShow = SW_NORMAL;
seInfo.hwnd = ::GetForegroundWindow();
seInfo.lpVerb = _T("open");
seInfo.lpFile = (const _TCHAR *)szShortPath;//File name including the path
seInfo.lpParameters = _T("/p");
ShellExecuteEx(&seInfo);
Upvotes: 2
Views: 3296
Reputation: 31
Looks like Microsoft Reader app does not register a print or printto verb. Probably >>because there isn't a method in the PrintManager class for automated printing. I suggest >>>you to disable the print feature when the registered program for the PDF file type does >>>>not register a pint or printto verb and instruct the user to change the default >>>>>program for PDF files.
Upvotes: 1