please dont rip this site Prev Next

Escape info  Overview  Group

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

int Escape(

    HDC hdc,

// handle to device context

    int nEscape,

// escape function

    int cbInput,

// number of bytes in input structure

    LPCSTR lpvInData,

// pointer to input structure

    LPVOID lpvOutData 

// pointer to output structure

   );

Parameters

hdc
Identifies the device context.
nEscape
Specifies the escape function to be performed. This parameter 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.

Remarks

The Win32 API provides six new functions that supersede some printer escapes:

Function

Description

AbortDoc

Terminates a print job. Supersedes the ABORTDOC escape.

EndDoc

Ends a print job. Supersedes the ENDDOC escape.

EndPage

Ends a page. Supersedes the NEWFRAME escape. Unlike NEWFRAME, this function is always called after printing a page.

SetAbortProc

Sets the abort function for a print job. Supersedes the SETABORTPROC escape.

StartDoc

Starts a print job. Supersedes the STARTDOC escape.

StartPage

Prepares printer driver to receive data.

The Win32 API provides six new indexes for the GetDeviceCaps function that supersede some printer escapes:

Index

Description

PHYSICALWIDTH

For printing devices: the width of the physical page, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper has a physical width value of 5100 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.

PHYSICALHEIGHT

For printing devices: the height of the physical page, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper has a physical height value of 6600 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.

PHYSICALOFFSETX

For printing devices: the distance from the left edge of the physical page to the left edge of the printable area, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper, that cannot print on the leftmost 0.25" of paper, has a horizontal physical offset of 150 device units.

PHYSICALOFFSETY

For printing devices: the distance from the top edge of the physical page to the top edge of the printable area, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper, that cannot print on the topmost 0.5" of paper, has a vertical physical offset of 300 device units.

Of the original printer escapes, only the following can be used by Win32-based application:

Escape

Description

QUERYYESCSUPPORT

Determines whether a particular escape is implemented by the device driver.

Following is a list of the obsolete printer escapes that are supported only for compatibility with 16-bit versions of Windows:

Escape

Description

ABORTDOC

Stops the current print job and erases everything the application has written to the device since the last ENDDOC escape.

ENDDOC

Ends a print job started by the STARTDOC escape.

GETPHYSPAGESIZE

Retrieves the physical page size and copies it to the specified location.

GETPRINTINGOFFSET

Retrieves the offset from the upper-left corner of the physical page where the actual printing or drawing begins.

GETSCALINGFACTOR

Retrieves the scaling factors for the x-axis and the y-axis of a printer.

NEWFRAME

Informs the printer that the application has finished writing to a page.

NEXTBAND

Informs the printer that the application has finished writing to a band.

PASSTHROUGH

Allows the application to send data directly to a printer.

SETABORTPROC

Sets the Abort function for a print job.

STARTDOC

Informs a printer driver that a new print job is starting.

See Also

AbortDoc, EndDoc, EndPage, ExtEscape, SetAbortProc, StartDoc, StartPage, ResetDC


file: /Techref/os/win/api/win32/func/src/f22_13.htm, 11KB, , updated: 2002/1/22 04:16, local time: 2024/11/10 04:44,
TOP NEW HELP FIND: 
3.137.188.66:LOG IN
©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://linistepper.com/Techref/os/win/api/win32/func/src/f22_13.htm"> Escape</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?