I still Need an API to get the Printers PaperBin Names 
Author Message
 I still Need an API to get the Printers PaperBin Names

NOTE:   VB version 4.0 16 bit ...

I'm unable to get the 'DeviceCapabilities' API to work.  Has anyone
out there got a working sample I can look at ??
I need to know the PaperBin and PaperSource names.  I see no other way
to get them.

Has anyone got a good replacement for the printerSetup part of the
commonDialog ??

To send me Email ... remove any (anti-spam) X's in my address



Sat, 26 May 2001 03:00:00 GMT  
 I still Need an API to get the Printers PaperBin Names
Have you tried the printer.paperbin and printer.papersize properties?
The returned values are numeric but the help file gives you the
interpretation.

Mike

Quote:

>NOTE:   VB version 4.0 16 bit ...

>I'm unable to get the 'DeviceCapabilities' API to work.  Has anyone
>out there got a working sample I can look at ??
>I need to know the PaperBin and PaperSource names.  I see no other way
>to get them.

>Has anyone got a good replacement for the printerSetup part of the
>commonDialog ??

>To send me Email ... remove any (anti-spam) X's in my address




Sat, 26 May 2001 03:00:00 GMT  
 I still Need an API to get the Printers PaperBin Names

Thanks Mike, but I know about the numeric return values.  What I need
are the text descriptions of the .paperbin and .papersize values (that
are different for each printer you might have installed).   What I
need is like the descriptors that are in the pulldowns in the
printersetup portion of the CommonDialog.    I'm trying to write a
replacement for that {*filter*}.   I'M SURE SOMEONE OUT THERE HAS TO
HAVE DONE THIS ALREADY ... but who ??

On Tue, 8 Dec 1998 11:46:27 -0000, "Mike Webb"

Quote:

>Have you tried the printer.paperbin and printer.papersize properties?
>The returned values are numeric but the help file gives you the
>interpretation.

>Mike


>>NOTE:   VB version 4.0 16 bit ...

>>I'm unable to get the 'DeviceCapabilities' API to work.  Has anyone
>>out there got a working sample I can look at ??
>>I need to know the PaperBin and PaperSource names.  I see no other way
>>to get them.

>>Has anyone got a good replacement for the printerSetup part of the
>>commonDialog ??

>>To send me Email ... remove any (anti-spam) X's in my address


To send me Email ... remove any (anti-spam) X's in my address



Sat, 26 May 2001 03:00:00 GMT  
 I still Need an API to get the Printers PaperBin Names
Hi Dave.

You can use the the win API to get a list of bin names. The function you
need is DeviceCapabilities. I've never used this myself but the declare is

Declare Function DeviceCapabilities Lib "winspool.drv" Alias
"DeviceCapabilitiesA" (ByVal lpDeviceName As String, ByVal lpPort As String,
ByVal iIndex As Long, ByVal lpOutput As String, lpDevMode As DEVMODE) As
Long

Note that DEVMODE is a structure that needs all kind of information.

I would personally look at the constants starting DM - not very elegent but
it works.

these are

DMPAPER_LETTER Letter, 8 1/2 x 11 in.
DMPAPER_LETTERSMALL Letter Small, 8 1/2 x 11 in.
DMPAPER_TABLOID Tabloid, 11 x 17 in.
DMPAPER_LEDGER Ledger, 17 x 11 in.
DMPAPER_LEGAL Legal, 8 1/2 x 14 in.
DMPAPER_STATEMENT Statement, 5 1/2 x 8 1/2 in.
DMPAPER_EXECUTIVE Executive, 7 1/2 x 10 1/2 in.
DMPAPER_A3 A3, 297 x 420 mm
DMPAPER_A4 A4, 210 x 297 mm
DMPAPER_A4SMALL A4 Small, 210 x 297 mm
DMPAPER_A5 A5, 148 x 210 mm
DMPAPER_B4 B4, 250 x 354 mm
DMPAPER_B5 B5, 182 x 257 mm
DMPAPER_FOLIO Folio, 8 1/2 x 13 in.
DMPAPER_QUARTO Quarto, 215 x 275 mm
DMPAPER_10X14 10 x 14 in.
DMPAPER_11X17 11 x 17 in.
DMPAPER_NOTE Note, 8 1/2 x 11 in.
DMPAPER_ENV_9 Envelope #9, 3 7/8 x 8 7/8 in.
DMPAPER_ENV_10 Envelope #10, 4 1/8 x 9 1/2 in.
DMPAPER_ENV_11 Envelope #11, 4 1/2 x 10 3/8 in.
DMPAPER_ENV_12 Envelope #12, 4 1/2 x 11 in.
DMPAPER_ENV_14 Envelope #14, 5 x 11 1/2 in.
DMPAPER_CSHEET C size sheet
DMPAPER_DSHEET D size sheet
DMPAPER_ESHEET E size sheet
DMPAPER_ENV_DL Envelope DL, 110 x 220 mm
DMPAPER_ENV_C3 Envelope C3, 324 x 458 mm
DMPAPER_ENV_C4 Envelope C4, 229 x 324 mm
DMPAPER_ENV_C5 Envelope C5, 162 x 229 mm
DMPAPER_ENV_C6 Envelope C6, 114 x 162 mm
DMPAPER_ENV_C65 Envelope C65, 114 x 229 mm
DMPAPER_ENV_B4 Envelope B4, 250 x 353 mm
DMPAPER_ENV_B5 Envelope B5, 176 x 250 mm
DMPAPER_ENV_B6 Envelope B6, 176 x 125 mm
DMPAPER_ENV_ITALY Envelope, 110 x 230 mm
DMPAPER_ENV_MONARCH Envelope Monarch, 3 7/8 x 7 1/2 in.
DMPAPER_ENV_PERSONAL Envelope, 3 5/8 x 6 1/2 in.
DMPAPER_FANFOLD_US U.S. Standard Fanfold, 14 7/8 x 11 in.
DMPAPER_FANFOLD_STD_GERMAN German Standard Fanfold, 8 1/2 x 12 in.
DMPAPER_FANFOLD_LGL_GERMAN German Legal Fanfold, 8 1/2 x 13 in.
DMPAPER_LAST German Legal Fanfold, 8 1/2 x 13 in.
DMPAPER_USER User-defined

And for the Bin

DMBIN_AUTO
DMBIN_LOWER
DMBIN_CASSETTE
DMBIN_MANUAL
DMBIN_ENVELOPE
DMBIN_MIDDLE
DMBIN_ENVMANUAL
DMBIN_ONLYONE
DMBIN_FIRST
DMBIN_SMALLFMT
DMBIN_LARGECAPACITY
DMBIN_TRACTOR
DMBIN_LARGEFMT
DMBIN_UPPER
DMBIN_LAST

Hope this helps.

Mike.

Quote:

>Thanks Mike, but I know about the numeric return values.  What I need
>are the text descriptions of the .paperbin and .papersize values (that
>are different for each printer you might have installed).   What I
>need is like the descriptors that are in the pulldowns in the
>printersetup portion of the CommonDialog.    I'm trying to write a
>replacement for that {*filter*}.   I'M SURE SOMEONE OUT THERE HAS TO
>HAVE DONE THIS ALREADY ... but who ??

>On Tue, 8 Dec 1998 11:46:27 -0000, "Mike Webb"

>>Have you tried the printer.paperbin and printer.papersize properties?
>>The returned values are numeric but the help file gives you the
>>interpretation.

>>Mike


>>>NOTE:   VB version 4.0 16 bit ...

>>>I'm unable to get the 'DeviceCapabilities' API to work.  Has anyone
>>>out there got a working sample I can look at ??
>>>I need to know the PaperBin and PaperSource names.  I see no other way
>>>to get them.

>>>Has anyone got a good replacement for the printerSetup part of the
>>>commonDialog ??

>>>To send me Email ... remove any (anti-spam) X's in my address

>To send me Email ... remove any (anti-spam) X's in my address




Sat, 26 May 2001 03:00:00 GMT  
 I still Need an API to get the Printers PaperBin Names

Quote:

>I'm unable to get the 'DeviceCapabilities' API to work.  Has anyone
>out there got a working sample I can look at ??
>I need to know the PaperBin and PaperSource names.  I see no other way
>to get them.

Unforunately for you, DeviceCapabilities is part of the printer driver.
That's means that there's no general way to access this function, or
you'd need a different declaration for each and every printer driver (=
a DLL also). So that is out.

What you can do, is use the free DLL that is on the disk accompaning
Daniel Appleman's API book. That forms a layer between VB and ANY
printer driver. See the book for a demo.

Quote:
>Has anyone got a good replacement for the printerSetup part of the
>commonDialog ??

Ah. The printerset up part of the printer driver, too. You can make it
appear by using ExtDeviceMode (or even DeviceMode), which is (ae)
supported in much the same way. Get the book. Then, it can be done.

   HTH,
   Bart.



Sat, 26 May 2001 03:00:00 GMT  
 I still Need an API to get the Printers PaperBin Names
Check article ID: Q194789 in Microsoft's kb.


Sat, 26 May 2001 03:00:00 GMT  
 I still Need an API to get the Printers PaperBin Names

What Mike is refering to is only available in 32 bit VB (as outlined
in MS KB article #Q194789) ... I need 16 bit ... drats !!!

I wonder if there's a 16 bit equivilant of winspool.drv ??
... dave sawvel

On Tue, 8 Dec 1998 20:12:59 -0000, "Mike Webb"

Quote:

>Hi Dave.

>You can use the the win API to get a list of bin names. The function you
>need is DeviceCapabilities. I've never used this myself but the declare is

>Declare Function DeviceCapabilities Lib "winspool.drv" Alias
>"DeviceCapabilitiesA" (ByVal lpDeviceName As String, ByVal lpPort As String,
>ByVal iIndex As Long, ByVal lpOutput As String, lpDevMode As DEVMODE) As
>Long

>Note that DEVMODE is a structure that needs all kind of information.

>I would personally look at the constants starting DM - not very elegent but
>it works.

>these are

>DMPAPER_LETTER Letter, 8 1/2 x 11 in.
>DMPAPER_LETTERSMALL Letter Small, 8 1/2 x 11 in.
>DMPAPER_TABLOID Tabloid, 11 x 17 in.
>DMPAPER_LEDGER Ledger, 17 x 11 in.
>DMPAPER_LEGAL Legal, 8 1/2 x 14 in.
>DMPAPER_STATEMENT Statement, 5 1/2 x 8 1/2 in.
>DMPAPER_EXECUTIVE Executive, 7 1/2 x 10 1/2 in.
>DMPAPER_A3 A3, 297 x 420 mm
>DMPAPER_A4 A4, 210 x 297 mm
>DMPAPER_A4SMALL A4 Small, 210 x 297 mm
>DMPAPER_A5 A5, 148 x 210 mm
>DMPAPER_B4 B4, 250 x 354 mm
>DMPAPER_B5 B5, 182 x 257 mm
>DMPAPER_FOLIO Folio, 8 1/2 x 13 in.
>DMPAPER_QUARTO Quarto, 215 x 275 mm
>DMPAPER_10X14 10 x 14 in.
>DMPAPER_11X17 11 x 17 in.
>DMPAPER_NOTE Note, 8 1/2 x 11 in.
>DMPAPER_ENV_9 Envelope #9, 3 7/8 x 8 7/8 in.
>DMPAPER_ENV_10 Envelope #10, 4 1/8 x 9 1/2 in.
>DMPAPER_ENV_11 Envelope #11, 4 1/2 x 10 3/8 in.
>DMPAPER_ENV_12 Envelope #12, 4 1/2 x 11 in.
>DMPAPER_ENV_14 Envelope #14, 5 x 11 1/2 in.
>DMPAPER_CSHEET C size sheet
>DMPAPER_DSHEET D size sheet
>DMPAPER_ESHEET E size sheet
>DMPAPER_ENV_DL Envelope DL, 110 x 220 mm
>DMPAPER_ENV_C3 Envelope C3, 324 x 458 mm
>DMPAPER_ENV_C4 Envelope C4, 229 x 324 mm
>DMPAPER_ENV_C5 Envelope C5, 162 x 229 mm
>DMPAPER_ENV_C6 Envelope C6, 114 x 162 mm
>DMPAPER_ENV_C65 Envelope C65, 114 x 229 mm
>DMPAPER_ENV_B4 Envelope B4, 250 x 353 mm
>DMPAPER_ENV_B5 Envelope B5, 176 x 250 mm
>DMPAPER_ENV_B6 Envelope B6, 176 x 125 mm
>DMPAPER_ENV_ITALY Envelope, 110 x 230 mm
>DMPAPER_ENV_MONARCH Envelope Monarch, 3 7/8 x 7 1/2 in.
>DMPAPER_ENV_PERSONAL Envelope, 3 5/8 x 6 1/2 in.
>DMPAPER_FANFOLD_US U.S. Standard Fanfold, 14 7/8 x 11 in.
>DMPAPER_FANFOLD_STD_GERMAN German Standard Fanfold, 8 1/2 x 12 in.
>DMPAPER_FANFOLD_LGL_GERMAN German Legal Fanfold, 8 1/2 x 13 in.
>DMPAPER_LAST German Legal Fanfold, 8 1/2 x 13 in.
>DMPAPER_USER User-defined

>And for the Bin

>DMBIN_AUTO
>DMBIN_LOWER
>DMBIN_CASSETTE
>DMBIN_MANUAL
>DMBIN_ENVELOPE
>DMBIN_MIDDLE
>DMBIN_ENVMANUAL
>DMBIN_ONLYONE
>DMBIN_FIRST
>DMBIN_SMALLFMT
>DMBIN_LARGECAPACITY
>DMBIN_TRACTOR
>DMBIN_LARGEFMT
>DMBIN_UPPER
>DMBIN_LAST

>Hope this helps.

>Mike.


>>Thanks Mike, but I know about the numeric return values.  What I need
>>are the text descriptions of the .paperbin and .papersize values (that
>>are different for each printer you might have installed).   What I
>>need is like the descriptors that are in the pulldowns in the
>>printersetup portion of the CommonDialog.    I'm trying to write a
>>replacement for that {*filter*}.   I'M SURE SOMEONE OUT THERE HAS TO
>>HAVE DONE THIS ALREADY ... but who ??

>>On Tue, 8 Dec 1998 11:46:27 -0000, "Mike Webb"

>>>Have you tried the printer.paperbin and printer.papersize properties?
>>>The returned values are numeric but the help file gives you the
>>>interpretation.

>>>Mike


>>>>NOTE:   VB version 4.0 16 bit ...

>>>>I'm unable to get the 'DeviceCapabilities' API to work.  Has anyone
>>>>out there got a working sample I can look at ??
>>>>I need to know the PaperBin and PaperSource names.  I see no other way
>>>>to get them.

>>>>Has anyone got a good replacement for the printerSetup part of the
>>>>commonDialog ??

>>>>To send me Email ... remove any (anti-spam) X's in my address

>>To send me Email ... remove any (anti-spam) X's in my address




Sun, 27 May 2001 03:00:00 GMT  
 I still Need an API to get the Printers PaperBin Names

Thanks Bart ... I'll check the book out.



Quote:

>>I'm unable to get the 'DeviceCapabilities' API to work.  Has anyone
>>out there got a working sample I can look at ??
>>I need to know the PaperBin and PaperSource names.  I see no other way
>>to get them.

>Unforunately for you, DeviceCapabilities is part of the printer driver.
>That's means that there's no general way to access this function, or
>you'd need a different declaration for each and every printer driver (=
>a DLL also). So that is out.

>What you can do, is use the free DLL that is on the disk accompaning
>Daniel Appleman's API book. That forms a layer between VB and ANY
>printer driver. See the book for a demo.

>>Has anyone got a good replacement for the printerSetup part of the
>>commonDialog ??

>Ah. The printerset up part of the printer driver, too. You can make it
>appear by using ExtDeviceMode (or even DeviceMode), which is (ae)
>supported in much the same way. Get the book. Then, it can be done.

>   HTH,
>   Bart.



Sun, 27 May 2001 03:00:00 GMT  
 I still Need an API to get the Printers PaperBin Names

There is a 16 bit version.
I only have the c definition but it's quiet easy to work out as long as you
can work out what file it is in. I don't have any 16 bit stuff available so
couldn't have a look for it.
The definition is:-

DWORD DeviceCapabilities(lpszDevice, lpszPort, fwCapability, lpszOutput,
lpdm)

LPSTR lpszDevice; /* address of device-name string */
LPSTR lpszPort; /* address of port-name string */
WORD fwCapability; /* device capability to query */
LPSTR lpszOutput; /* address of the output */
LPDEVMODE lpdm; /* address of structure with device data */

The constants are the same only words.

Mike

Quote:

>What Mike is refering to is only available in 32 bit VB (as outlined
>in MS KB article #Q194789) ... I need 16 bit ... drats !!!

>I wonder if there's a 16 bit equivilant of winspool.drv ??
>... dave sawvel

>On Tue, 8 Dec 1998 20:12:59 -0000, "Mike Webb"




Sun, 27 May 2001 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Need an API to get the Printers PaperBin Names

2. I still Need an API to get the Printers PaperBin Names

3. Need an API to get the Printers PaperBin Names

4. Answer: Getting Printer PaperBin/PaperSize settings

5. Getting default printer name from Printers Collection

6. Printer.PaperSize, Printer.PaperBin

7. Pulling PC Cam stills with an API

8. PRINTER : Need API that gives Printable/NonPrintable Area of Printer

9. Changing Printer names (displayed names in printer folder)

10. Getting valid printer names

11. Getting Printer Names

12. Getting printer name from Common dialog control

 

 
Powered by phpBB® Forum Software