Mensaje
 
a
21/06/2001 08:19:39
General information
Foro:
Visual FoxPro
Category:
Funciones del API WIN32
Miscellaneous
ID de la conversación:
00521829
ID del mensaje:
00522314
Views:
18
Hi, Daniel!
My suggestion is to pause printer before printing documents and resume after. The code below is tested, but I'm not absolutely sure.

#define PRINTER_CONTROL_PAUSE 1
#define PRINTER_CONTROL_RESUME 2
#define PRINTER_ACCESS_ADMINISTER 4

Declare integer OpenPrinterA in "winspool.drv" as OpenPrinter ;
String pPrinterName, ;
Long @ phPrinter, ;
String pDefault
Declare integer SetPrinterA in "winspool.drv" as SetPrinter ;
Long hPrinter, ;
Long Level, ;
Long pPrinter, ;
Long Command
Declare integer ClosePrinter in "winspool.drv" as ClosePrinter ;
Long hPrinter
Declare Integer GetLastError in Win32API

hPrinter = 0
pDefault = Replicate(Chr(0), 8) + Chr(PRINTER_ACCESS_ADMINISTER) + Replicate(Chr(0), 3)
pName = Set("PRINTER", 2)
OpenPrinter(pName, @ hPrinter, pDefault)
SetPrinter(hPrinter, 0, 0, PRINTER_CONTROL_PAUSE)
* ......
* Print your documents here
* ......
SetPrinter(hPrinter, 0, 0, PRINTER_CONTROL_RESUME)
ClosePrinter(hPrinter)

>Hello everyone,
>
>This is a requirement of a new application I am developing:
>
>Must develop a process that will queue documents in a custom order to a predetermined location and release them to the network printer queue only when the local queuing is complete.
>
>The documents may be of different types.
>
>Anybody know how to do this?
Previous
Next
Responder
Mapa
Ver