Link to home
Start Free TrialLog in
Avatar of Rguess
Rguess

asked on

Printing To default printer

I am trying to batch lprint  in the background. However I get the print dialog box poping up when I execute

ShellExecute(Scr_hDC, "print", DocName, "", "C:\", 0)

Does anyone know how I can either control and select the printer that I want programatically or just send the document to a specified printer?

Thanks in advance!!
Avatar of vinnyd79
vinnyd79

Does it bring up the print dialog for all types of files or just certain ones?
Avatar of Rguess

ASKER

for all files
Avatar of Rguess

ASKER

FYI --It is the box that asks you to select a printer.
Have you tried changing the system default printer before calling ShellExecute?
If not,here is how you can change it:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;266767
Avatar of Rguess

ASKER

Yes, I am changing the default printer.
If you right click a file and select print,does it also bring up the printer dialog box?
Is this only happening on a particular system?
ASKER CERTIFIED SOLUTION
Avatar of Eddyzr
Eddyzr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial