Escape

Syntax

int Escape(hDC,nEscape,nCount,lpInData,lpOutData)

This function allows applications to access facilities of a particular device that are not directly available through GDI. Escape calls made by an application are translated and sent to the device driver.

Parameter Type/Description  

hDC HDC Identifies the device context.  
nEscape int Specifies the escape function to be performed. For a complete list of escape functions, see Chapter 8, “Printer Escapes.”  
nCount int Specifies the number of bytes of data pointed to by the lpInData parameter.  
lpInData LPSTR Points to the input data structure required for this escape.  
lpOutData LPSTR Points to the data structure to receive output from this escape. The lpOutData parameter should be NULL if no data are returned.  

Return Value

The return value specifies the outcome of the function. It is positive if the function is successful except for the QUERYESCSUPPORT escape, which only checks for implementation. The return value is zero if the escape is not implemented. A negative value indicates an error. The following list shows common error values:

Value Meaning

SP_ERROR General error.
SP_OUTOFDISK Not enough disk space is currently available for spooling, and no more space will become available.
SP_OUTOFMEMORY Not enough memory is available for spooling.
SP_USERABORT User terminated the job through the Print Manager.