Printer Forms Manager

This forum is for ideas and or code to be contributed for general use.
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4159
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Printer Forms Manager

#1 Post by rdonnay »

Here is the source for a utility that lets you Add, Change or Delete printer forms.
http://bb.donnay-software.com/donnay/PrinterForms.Prg

It uses the following Windows API calls:

Code: Select all

DLLFUNCTION AddFormA( hPrinter, nLevel, sForm ) USING STDCALL FROM WINSPOOL.DRV

DLLFUNCTION OpenPrinterA( cPrinterName, @hPrinter, sDefaults ) USING STDCALL FROM WINSPOOL.DRV

DLLFUNCTION ClosePrinter( hPrinter ) USING STDCALL FROM WINSPOOL.DRV

DLLFUNCTION SetFormA( hPrinter, cFormName, nLevel, sForm ) USING STDCALL FROM WINSPOOL.DRV

DLLFUNCTION GetLastError() USING STDCALL FROM KERNEL32.DLL

DLLFUNCTION DeleteFormA( hPrinter, cFormName ) USING STDCALL FROM WINSPOOL.DRV
PrinterForms.JPG
PrinterForms.JPG (233.31 KiB) Viewed 7552 times
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 490
Joined: Thu Feb 11, 2010 1:39 pm

Re: Printer Forms Manager

#2 Post by unixkd »

Hi Roger

Very nice tool.

Is it possible to add a Button that can call up the :setupDialog() for each printer, modify the printer properties and save it back for subsequent use.

Thanks

Joe

User avatar
rdonnay
Site Admin
Posts: 4159
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Printer Forms Manager

#3 Post by rdonnay »

add a Button that can call up the :setupDialog()

Code: Select all

@ DCGUI_ROW, DCGUI_COL + 10 DCPUSHBUTTON CAPTION 'Printer Properties' SIZE 20,1.2 ;
       ACTION {|o|o := XbpPrinter():new():create(cPrinterName):setupDialog(), o:destroy()}
I updated the source at http://bb.donnay-software.com/donnay/printerforms.prg.
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 490
Joined: Thu Feb 11, 2010 1:39 pm

Re: Printer Forms Manager

#4 Post by unixkd »

Hi Roger

Thanks for the response.

One more thing. The properties setting are not saved when it is edited/updated and the OK button is clicked in the properties page.

Joe

User avatar
rdonnay
Site Admin
Posts: 4159
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Printer Forms Manager

#5 Post by rdonnay »

The properties setting are not saved
There is nothing i can do about that.
Why don't you give it a try.
The eXpress train is coming - and it has more cars.

Post Reply