Desktop Functions:

   Smart Device Functions:

Show Recent Changes
Subscribe (RSS)
Misc. Pages
Helpful Tools
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
ExtEscape (gdi32)

C# Signature:

static extern int ExtEscape(IntPtr hdc, int nEscape, int cbInput,
   string lpszInData, int cbOutput, IntPtr lpszOutData);

VB.NET Signature:

     <DllImport("gdi32.dll")> _
    Public Shared Function ExtEscape(ByVal hdc As IntPtr, ByVal nEscape As Integer, ByVal cbInput As Integer, ByVal lpszInData As String, ByVal cbOutput As Integer, ByRef lpszOutData As IntPtr) As Integer
    End Function

User-Defined Types:




Tips & Tricks:

Please add some!

Sample Code:

           //By Justin Alexander, aka TheLoneCabbage

        static Int32 GETTECHNOLOGY = 20;
        static Int32 QUERYESCSUPPORT = 8;
        static Int32 POSTSCRIPT_PASSTHROUGH     =     4115;
        static Int32 ENCAPSULATED_POSTSCRIPT= 4116;

        static Int32 POSTSCRIPT_IDENTIFY    =     4117;
        static Int32 POSTSCRIPT_INJECTION       =     4118;
        static Int32 POSTSCRIPT_DATA        =     37;
        static Int32 POSTSCRIPT_IGNORE      =     38;

        static bool PrinterSupportsPostScript(string printername)
            ArrayList PSChecks=new ArrayList();

            IntPtr hDC=IntPtr.Zero;;
            IntPtr BLOB=IntPtr.Zero;

                hDC =CreateDC(null,printername,0,IntPtr.Zero);

                int isz=4;
                BLOB = Marshal.AllocCoTaskMem(isz);

                int test=ExtEscape( hDC, QUERYESCSUPPORT, 4, BLOB, 0, IntPtr.Zero);
                if(test==0) return false; // printer driver does not support GETTECHNOLOGY Checks.

                foreach(Int32 val in PSChecks)
                    test = ExtEscape(hDC,QUERYESCSUPPORT,isz,BLOB,0, IntPtr.Zero);
                    if(test!=0) return true; // if any of the checks pass, return true
            catch(Exception ex){Trace.WriteLine(ex);}
                if(hDC!=IntPtr.Zero) DeleteDC(hDC);

                if(BLOB!=IntPtr.Zero) Marshal.Release(BLOB);

            return false;


Alternative Managed API:

Do you know one? Please contribute it!

ExtEscape on MSDN

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

Access directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version