Escape 函数使你的程序能过使用不能直接通过 GUI 直接使用的某一个特定的设备能
力, 他能将信息翻译并发送到该设备.
function Escape(
DC: HDC; // handle to device context
nEscape, // escape function
cbInput: integer;
// number of bytes in input structure
lpvInData: LPCSTR;
// pointer to input structure
lpvOutData: pointer;
// pointer to output structure
);
Parameters
DC: Identifies the device context.
nEscape: Specifies the escape function to be performed. This arameter
must be one of the predefined escape values. Use the ExtEscape
function if your application defines a private escape value.
cbInput: Specifies the number of bytes of data pointed to by the
lpvInData parameter.
lpvInData: Points to the input structure required for the specified
escape.
lpvOutData: Points to the structure that receives output from this
escape. This parameter should be NULL if no data is returned.
Return Values
If the function succeeds, the return value is greater than zero, except with the QUERYESCSUPPORT printer escape, which checks for implementation only. If the escape is not implemented, the return value is zero.
If the function fails, the return value is an error. To get extended error information, call GetLastError.
Errors
If the function fails, the return value is one of the following values.
Value Meaning
SP_ERROR: General error. If SP_ERROR is returned, Escape may set the
last error code to:
ERROR_INVALID_PARAMETER
ERROR_DISK_FULL
ERROR_NOT_ENOUGH_MEMORY
ERROR_PRINT_CANCELLED
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: The user terminated the job through Windows Print Manager.