?
Solved

Shell32.dll print : what are the parameters ?

Posted on 2004-10-27
4
Medium Priority
?
1,409 Views
Last Modified: 2011-09-20
Hi

I need to print a prdf file without human intervention... so i did the following program in c# :

[DllImport("shell32.dll")]
private static extern int ShellExecuteA(IntPtr hwnd,string operation,string file,string paramters,string directory,int showcmd);
string fichier_local = @"d:\csharp\toto.pdf" ;
if (fichier_local != null) ShellExecuteA(IntPtr.Zero, "print", fichier_local, null, null, 0);

it works like a charm, but it prints to the default printer, and the default tray.
I need to specify the printer and more important the tray.

In fact the program has to print 3 pdf files,
- one using normal paper tray 1,
- one using special paper in tray 2
- one using another paper in tray 3

Could you help me ?
0
Comment
Question by:moby59
3 Comments
 
LVL 6

Expert Comment

by:Chester_M_Ragel
ID: 12431240
This may help you..
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21012246.html

I Don't have any experience with this. Anyway I'm sure that you must specify the printer and tray in  

ShellExecuteA(IntPtr.Zero, "print", fichier_local, null, null, 0);

It must be the 1st parameter. The first parameter must be changed and you must pass the handle to the printer which you want to printer.
0
 

Author Comment

by:moby59
ID: 12642293
no real answer given :-(

I made a VB6 program and changed the default system printer, then print, then change the default printer...

0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12663746
PAQed with points refunded (250)

modulo
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Integration Management Part 2
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question