bb.donnay-software.com

Donnay Software Web Forums
It is currently Tue Aug 04, 2020 1:26 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Printer Forms Manager
PostPosted: Sun Mar 05, 2017 12:17 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4144
Location: Boise, Idaho USA
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:
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


Attachment:
PrinterForms.JPG
PrinterForms.JPG [ 233.31 KiB | Viewed 7177 times ]

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 1:08 am 
Offline
User avatar

Joined: Thu Feb 11, 2010 1:39 pm
Posts: 490
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


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 7:49 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4144
Location: Boise, Idaho USA
Quote:
add a Button that can call up the :setupDialog()


Code:
@ 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.


Top
 Profile  
 
PostPosted: Wed Mar 08, 2017 12:13 am 
Offline
User avatar

Joined: Thu Feb 11, 2010 1:39 pm
Posts: 490
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


Top
 Profile  
 
PostPosted: Wed Mar 08, 2017 8:00 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4144
Location: Boise, Idaho USA
Quote:
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group