GETSETPAPERBINS

short Escape(hdc, GETSETPAPERBINS,nCount,lpInData,lpOutData)

The GETSETPAPERBINS printer escape is maintained for backwards compatibility. Applications written for Windows 3.1 should call the DeviceCapabilities function with the DC_BINS index to retrieve the number of available paper bins and use the ExtDeviceMode function to set the current paper bin.

This escape retrieves the number of paper bins available on a printer and sets the current paper bin. For more information about actions performed by this escape, see the following Comments section.

Parameters

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 structure that specifies the new paper bin. It may be set to NULL. For more information about this structure, see the following Comments section.

lpOutData

BinInfo FAR * Points to a BinInfo structure that contains information about the current or previous paper bin and the number of bins available. For more information about this structure, see the following comments section.

Return Value

The return value is positive if the escape is successful. Otherwise, this value is zero or negative.

Comments

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 member of the structure to which the lpInData parameter points and retrieves the number of the previous bin.
BinInfo NULL Sets the current bin to the number specified in the BinNumber member of the structure to which the lpInData parameter points.

The BinInfo structure has the following form:

struct BinInfo {
    int BinNumber;
    int cBins;
    int Reserved;
    int Reserved;
    int Reserved;
    int Reserved;
};

Following are the members of the BinInfo structure:

BinNumber

Identifies the current or previous paper bin.

cBins

Specifies the number of paper bins available.

Once a new bin is set, the selection takes effect immediately; the next page printed comes from the new bin.