DEVESC_SETMODE
Appearance
GreEscape DEVESC_SETMODE sets the printer into a particular mode.
- Simulation support
- This function is mandatory for hardcopy drivers, but may simply return a DEVESC_NOTIMPLEMENTED code. For other drivers, it is simulated by a handling routine in the graphics engine.
Syntax
GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction);
Parameters
- hdc (HDC) - input
- Device context handle.
- lEscape (LONG) - input
- DEVESC_SETMODE escape code.
- cInCount (LONG) - input
- Number of bytes pointed to by pInData.
- pInData (PBYTE) - input
- Pointer to the buffer that contains an ESCMODE structure.
- pcOutCount (PLONG) - input
- The handling routine ignores this parameter.
- pOutData (PLONG) - input
- The handling routine ignores this parameter.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreEscape.
Returns
- rc (LONG) - returns
- Return Code.
- The handling routine returns:
- DEV_OK
- Successful
- DEVESC_NOTIMPLEMENTED
- Escape not implemented for specified code
- DEVESC_ERROR
- Error
Remarks
Although it is optional for hardcopy drivers to support this function, those that do support it need to know the code page of any of the built-in fonts. For example, if only Code Page 437 is built-in, it is the code page used if 437 is requested by GreEscape DEVESC_SETMODE. If Code Page 865 is requested, a suitable code page or font could be downloaded.
This escape code is metafiled and recorded.
Source Code Sample
Declaration:
#define INCL_GRE_DEVICE #include <os2.h> HDC hdc; /* Device context handle. */ LONG lEscape; /* DEVESC_SETMODE escape code. */ LONG cInCount; /* Number of bytes pointed to by pInData. */ PBYTE pInData; /* Pointer to the buffer that contains an ESCMODE structure. */ PLONG pcOutCount; /* The handling routine ignores this parameter. */ PLONG pOutData; /* The handling routine ignores this parameter. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreEscape. */ LONG rc; /* Return Code. */ rc = GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction);