Windows 3.1 Device Drivers (ddag31qh.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
ENUMPAPERMETRICS
◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define ENUMPAPERMETRICS 34
short Control(lpDevice, ENUMPAPERMETRICS, lpInData, lpOutData)
LPPDEVICE lpDevice;
LPINT lpInData;
LPRECT lpOutData;
The ENUMPAPERMETRICS escape either retrieves the number of paper types
supported by the driver, or fills an array of RECT structures with the
dimensions of each paper type.
The ExtDeviceMode function achieves the same results.
Parameter Description
────────────────────────────────────────────────────────────────────────────
lpDevice Points to a PDEVICE structure specifying the destination device.
lpInData Points to an 16-bit variable that specifies what action to take.
If the variable is zero, the escape returns the number of paper
types. If zero, the escape fills an array of RECT structures with
paper dimensions.
lpOutData Points to an array of RECT structures that receive the
coordinates of the imageable area of the page. The top-left
corner of the rectangle specifies the page margins, and the
bottom-right corner specifies the sum of the page margins and the
width and height of the imageable area. The units are device
coordinates. The orientation returned is always portrait.
Return Value
The return value is positive, if successful. Otherwise, it is zero if the
escape is not implemented, and negative if an error occurs.
Comments
The following example illustrates the required actions:
#define ENUMPAPERMETRICS 34
#define INFORM 0
#define PERFORM 1
int cPaperTypes = CPAPERTYPES;
RECT arectPage[CPAPERTYPES] = { ... };
short Control(lpDevice, wFunction, lpInData, lpOutData)
LPPDEVICE lpDevice;
WORD wFunction;
LPVOID lpInData;
LPVOID lpOutData;
{
LPRECT arect;
switch (wFunction) {
case ENUMPAPERMETRICS:
switch (*((LPINT)lpInData)) {
case INFORM:
return cPaperTypes;
case PERFORM:
arect = (LPRECT)lpOutData;
for (i=0; i<cPaperTypes; arect++, i++)
CopyRect(arect, arectPage[i]);
return cPaperTypes;
default:
return 0;
}
.
.
.
}
See Also
ExtDeviceMode, PDEVICE, RECT
♦