short Escape(hDC, GETSETPAPERBINS,nCount,lpInData,lpOutData)
This escape retrieves the number of paper bins available on a printer and sets the current paper bin. See the following “Comments” section for more information on the actions performed by this escape.
Parameter | Type/Description |
hDC | HDC Identifies the device context. | |
nCount | int Specifies the number of bytes pointed to by the lpInData parameter. | |
lpInData | BinInfo FAR * Points to a BinInfo data structure that specifies the new paper bin. It may be set to NULL. | |
lpOutData | BinInfo FAR * Points to a BinInfo data structure that contains information about the current or previous paper bin and the number of bins available. |
There are three possible actions for this escape, depending on the values passed in the
lpInData and lpOutData parameters:
lpInData | lpOutData | Action |
NULL | BinInfo | Retrieves the number of bins and the number of the current bin. |
BinInfo | BinInfo | Sets the current bin to the number specified in the BinNumber field of the data structure to which lpInData points and retrieves the number of the previous bin. |
BinInfo | NULL | Sets the current bin to the number specified in the BinNumber field of the data structure to which lpInData points. |
The BinInfo data structure has the following format:
typedef struct{
DWORD BinNumber;
DWORD NbrofBins;
DWORDReserved;
DWORDReserved;
DWORDReserved;
DWORDReserved;
} BinInfo;
The BinInfo structure has the following fields:
Field | Description |
BinNumber | Identifies the current or previous paper bin. | |
NbrofBins | Specifies the number of paper bins available. |
When setting a new bin, the setting does not take effect until a new device context is created (without initialization data). The setting will take immediate effect if the high bit of the bin number is set, so that the next page printed will come from the new bin. For example, 0x8001 uses the second bin immediately whenever 0x0001 sets the same bin as the default for later print jobs.
In general, only the immediate-selection form should be used by applications. Setting the bin for future print jobs is supported for backward compatibility to an earlier form of this escape which appeared in some versions of HP's Page Control Language (PCL) and PostScript.