Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


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

Search Results for "print" in [All]

mpr

.

        RESOURCETYPE_PRINT,

.

  //      RESOURCETYPE_PRINT      = 2,

.

    Print = 2,

.

        RESOURCETYPE_PRINT,

.

    RESOURCETYPE_PRINT = 0x00000002,

.

    RESOURCETYPE_PRINT = &H2

.

localName is the local name for the network resource (drive or printer)

.

    PRINT   = 0x00000002,

shlwapi

.

     "print", null, ref size);

.

     "print", sb, ref size);

.

   Console.WriteLine(".doc is printed by : {0}", sb.ToString());

.

     Console.WriteLine("No command line is associated to .doc print verb.");

winmm

.

"WAVEOUTCAPS" [http://msdn2.microsoft.com/en-us/library/ms713743(d=printer).aspx]

netapi32

.

    ''' Admin, Accounts, Print, or Server Operator group membership is required to successfully execute NetMessageBufferSend on a remote server.

.

            PrintQueueServer = 0x00000200,

.

            MicrosoftFileAndPrintServer= 0x00004000,

.

            SV_TYPE_PRINTQ_SERVER = 0x00000200,

.

    PrintQueueServer = 0x00000200,

.

    MicrosoftFileAndPrintServer= 0x00004000,

.

            STYPE_PRINTQ = 1,

.

        ' <summary>Printer Share</summary>

.

        Printer = 1

.

            STYPE_PRINTQ = 1,

.

        STYPE_PRINTQ = 1,

.
Summary
The NetUseAdd function establishes a connection between the local computer and a remote server. You can specify a local drive letter or a printer device to connect. If you do not specify a local drive letter or printer device, the function authenticates the client with the server for future connections.

Constants

.

    public static readonly Guid GUID_DEVCLASS_DOT4PRINT = new Guid("{0x49ce6ac8, 0x6f86, 0x11d2, {0xb1, 0xe5, 0x00, 0x80, 0xc7, 0x2e, 0x74, 0xa2}}");

.

    public static readonly Guid GUID_DEVCLASS_PNPPRINTERS = new Guid("{0x4658ee7e, 0xf050, 0x11d1, {0xb6, 0xbd, 0x00, 0xc0, 0x4f, 0xa3, 0x72, 0xa7}}");

.

    public static readonly Guid GUID_DEVCLASS_PRINTER = new Guid("{0x4d36e979, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}}");

.

    public static readonly Guid GUID_DEVCLASS_PRINTERUPGRADE = new Guid("{0x4d36e97a, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}}");

16: NERR_
.

        /// <summary> 2150 - The printer does not exist. </summary>

.

        /// <summary> 2151 - The print job does not exist. </summary>

.

        /// <summary> 2152 - The printer destination cannot be found. </summary>

.

        /// <summary> 2153 - The printer destination already exists. </summary>

.

        /// <summary> 2154 - The printer queue already exists. </summary>

.

        /// <summary> 2155 - No more printers can be added. </summary>

.

        /// <summary> 2156 - No more print jobs can be added. </summary>

.

        /// <summary> 2157 - No more printer destinations can be added. </summary>

.

        /// <summary> 2158 - This printer destination is idle and cannot accept control operations. </summary>

.

        /// <summary> 2159 - This printer destination request contains an invalid control function. </summary>

.

        /// <summary> 2160 - The print processor is not responding. </summary>

.

        /// <summary> 2162 - This operation cannot be performed on the print destination in its current state. </summary>

.

        /// <summary> 2163 - This operation cannot be performed on the printer queue in its current state. </summary>

.

        /// <summary> 2164 - This operation cannot be performed on the print job in its current state. </summary>

.

        /// <summary> 2167 - The data type is not supported by the print processor. </summary>

.

        /// <summary> 2168 - The print processor is not installed. </summary>

.

private const int PRINTER_ACCESS_ADMINISTRATOR = 0x4;

.

private const int PRINTER_ACCESS_USE = 0x8;

.

private const int PRINTER_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | PRINTER_ACCESS_ADMINISTRATOR | PRINTER_ACCESS_USE;

.

    public static PropertyKey PKEY_Document_DatePrinted = new PropertyKey( 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 11);

.

const UInt32 RESOURCETYPE_PRINT = 0x00000002;

.

    public const int PO_DELETE      = 0x0013;  // printer is being deleted

.

    public const int PO_RENAME      = 0x0014;  // printer is being renamed

.

    public const int PO_PORTCHANGE  = 0x0020;  // port this printer connected to is being changed

.

        // list of strings.  The first is the printer

.

        // name and the second is the printer port.

.

    // Printer stuff

.

    public const int PRINTACTION_OPEN         = 0;

.

    public const int PRINTACTION_PROPERTIES       = 1;

.

    public const int PRINTACTION_NETINSTALL       = 2;

.

    public const int PRINTACTION_NETINSTALLLINK   = 3;

.

    public const int PRINTACTION_TESTPAGE     = 4;

.

    public const int PRINTACTION_OPENNETPRN       = 5;

.

    public const int PRINTACTION_DOCUMENTDEFAULTS = 6;

.

    public const int PRINTACTION_SERVERPROPERTIES = 7;

.

    public const int PO_DELETE      = 0x0013;  // printer is being deleted

.

    public const int PO_RENAME      = 0x0014;  // printer is being renamed

.

    public const int PO_PORTCHANGE  = 0x0020;  // port this printer connected to is being changed

.

        // list of strings.  The first is the printer

.

        // name and the second is the printer port.

.

    // Printer stuff

.

    public const int PRINTACTION_OPEN         = 0;

.

    public const int PRINTACTION_PROPERTIES       = 1;

.

    public const int PRINTACTION_NETINSTALL       = 2;

.

    public const int PRINTACTION_NETINSTALLLINK   = 3;

.

    public const int PRINTACTION_TESTPAGE     = 4;

.

    public const int PRINTACTION_OPENNETPRN       = 5;

.

    public const int PRINTACTION_DOCUMENTDEFAULTS = 6;

.

    public const int PRINTACTION_SERVERPROPERTIES = 7;

.

        /// The printer is out of paper.

.

        /// The printer queue is full.

.

        public const int ERROR_PRINTQ_FULL = 61;

.

        /// Space to store the file waiting to be printed is not available on the server.

.

        /// Your file waiting to be printed was deleted.

.

        public const int ERROR_PRINT_CANCELLED = 63;

.

        /// The specified printer or disk device has been paused.

.

        /// The specified printer driver is already installed.

.

        public const int ERROR_PRINTER_DRIVER_ALREADY_INSTALLED = 1795;

.

        /// The printer driver is unknown.

.

        public const int ERROR_UNKNOWN_PRINTER_DRIVER = 1797;

.

        /// The print processor is unknown.

.

        public const int ERROR_UNKNOWN_PRINTPROCESSOR = 1798;

.

        /// The printer name is invalid.

.

        public const int ERROR_INVALID_PRINTER_NAME = 1801;

.

        /// The printer already exists.

.

        public const int ERROR_PRINTER_ALREADY_EXISTS = 1802;

.

        /// The printer command is invalid.

.

        public const int ERROR_INVALID_PRINTER_COMMAND = 1803;

.

        /// The specified printer handle is already being waited on

.

        /// The specified printer has been deleted.

.

        public const int ERROR_PRINTER_DELETED = 1905;

.

        /// The state of the printer is invalid.

.

        public const int ERROR_INVALID_PRINTER_STATE = 1906;

.

        /// The printer driver is not compatible with a policy enabled on your computer that blocks NT 4.0 drivers.

.

        public const int ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED = 1936;

.

        /// The specified print monitor is unknown.

.

        public const int ERROR_UNKNOWN_PRINT_MONITOR = 3000;

.

        /// The specified printer driver is currently in use.

.

        public const int ERROR_PRINTER_DRIVER_IN_USE = 3001;

.

        /// A StartDocPrinter call was not issued.

.

        /// The specified print processor has already been installed.

.

        public const int ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED = 3005;

.

        /// The specified print monitor has already been installed.

.

        public const int ERROR_PRINT_MONITOR_ALREADY_INSTALLED = 3006;

.

        /// The specified print monitor does not have the required functions.

.

        public const int ERROR_INVALID_PRINT_MONITOR = 3007;

.

        /// The specified print monitor is currently in use.

.

        public const int ERROR_PRINT_MONITOR_IN_USE = 3008;

.

        /// The requested operation is not allowed when there are jobs queued to the printer.

.

        public const int ERROR_PRINTER_HAS_JOBS_QUEUED = 3009;

.

        /// No printers were found.

.

        public const int ERROR_PRINTER_NOT_FOUND = 3012;

.

        /// The printer driver is known to be unreliable.

.

        public const int ERROR_PRINTER_DRIVER_WARNED = 3013;

.

        /// The printer driver is known to harm the system.

.

        public const int ERROR_PRINTER_DRIVER_BLOCKED = 3014;

.

        /// The string contains a non-printable character.

.

        public const int CRYPT_E_INVALID_PRINTABLE_STRING = (int)(0x80092021 - 0x100000000);

23: WM
.
WM_PRINT 0x317 The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.
.
WM_PRINTCLIENT 0x318 The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.
.
WM_SPOOLERSTATUS 0x2A The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue.
.

private const UInt32 WM_PRINT          = 0x0317;

.

private const UInt32 WM_PRINTCLIENT        = 0x0318;

.

   WM_PRINT = &H317

.

   WM_PRINTCLIENT = &H318

.

WM_PRINT          equ 317h

.

WM_PRINTCLIENT        equ 318h

crypt32

.

   printf("Opened the MY system store. \n");

.

   printf( "Could not open the MY system store.\n");

.

  printf("The MY store is duplicated.\n");

.

  printf("Duplication of the MY store failed.\n.");

userenv

.

        printf("%d %s\n", (int)size, path);

.

        printf("%d %s\n", (int)size, path);

setupapi

.

Text1.Text = SendToUsbPrinter(”Hello world.”)

.

Function SendToUsbPrinter(PrintOut As String) As Boolean

.

SendToUsbPrinter = False

.

Debug.Print DeviceName

.

Debug.Print “Open failed on ” & DeviceName

.

Ret = WriteFile(DeviceHandle, PrintOut, _

.

Len(PrintOut), BytesWritten, 0)

.

Debug.Print “Sent ” & BytesWritten & ” bytes.”

.

SendToUsbPrinter = True

Interfaces

.

      void PrintTemplateInstantiation([MarshalAs(UnmanagedType.IDispatch)] object pDisp);

.

      void PrintTemplateTeardown([MarshalAs(UnmanagedType.IDispatch)] object pDisp);

.

      Sub PrintTemplateInstantiation(<MarshalAs(UnmanagedType.IDispatch)> ByVal pDisp As Object)

.

      Sub PrintTemplateTeardown(<MarshalAs(UnmanagedType.IDispatch)> ByVal pDisp As Object)

.

        // the autocomplete object treats pwszQuickComplete as a sprintf

.

        #region Print

.

        /// Prints the current view. Print Dialog does not appear and therefore a document

.

        /// will be printed.with the default printer settings

.

        public void Print()

.

                    InfoPathControl.XmlForm.Print();

.

                    //NOTE: XmlForm.Print(true) will NOT show the print dialog.

.

                    //The print dialog is not supported in hosting scenarios

.

                    throw new HostedException("An error occurred while attempting to print this form", ex);

.

    SHCONTF_NETPRINTERSRCH = 0x0200,

.

        Debug.Print("\r\nCount =>" + iHistoryCount.ToString());

.

                Debug.Print("\r\nTitle =>" + Marshal.PtrToStringUni(pTitle));

.

                Debug.Print("\r\nUrl =>" + Marshal.PtrToStringUni(pUrl));

Structures

.
Summary
Contains information about the initialization and environment of a printer or a display device.
.

    Int16 dmPrintQuality;

.

    Public dmPrintQuality As Short

.

This code (taken from .NET source code) is working with System.Drawing.Printing.PrinterSettings.Gethdevmode, where default structure doesn't work for me.

.

    public Int16 dmPrintQuality;

.

struct FAX_PRINT_INFO {

.
Documentation
[FAX_PRINT_INFO] on MSDN
.

    DVASPECT_DOCPRINT = 8

.

    DVASPECT_DOCPRINT = 8

.
Summary
The JOB_INFO_1 structure specifies print-job information such as the job-identifier value, the name of the printer for which the job is spooled, the name of the machine that created the print job, the name of the user that owns the print job, and so on.
.

   public string pPrinterName;

.

   public UInt32 PagesPrinted;

.

        ///PRINT key

.

        PRINT = 0x2A,

.

        ///PRINT SCREEN key

.

        PRINT = 0,

.

public class PRINTDLG

.

    public IntPtr lpfnPrintHook;

.

    public IntPtr lpPrintTemplateName;

.

    public IntPtr hPrintTemplate;

.

Structure PRINTDLG

.
Documentation
[PRINTDLG] on MSDN
.
Summary
.

struct PRINTER_DEFAULTS {

.

/// The PRINTER_DEFAULTS structure specifies the default data type,

.

/// environment, initialization data, and access rights for a printer.

.

internal class PRINTER_DEFAULTS

.

   /// default data type for a printer.

.

   /// default environment and initialization data for a printer.

.

   /// Specifies desired access rights for a printer.

.

   /// The <see cref="OpenPrinter(string, out IntPtr, IntPtr)"/> function uses

.

   /// this member to set access rights to the printer. These rights can affect

.

   /// the operation of the SetPrinter and DeletePrinter functions.

.

Structure PRINTER_DEFAULTS

.

If you use the class-version, you only need one OpenPrinter declaration, because you can pass NULL or an object references.

.
Documentation
[PRINTER_DEFAULTS] on MSDN
.
Summary
Used by the EnumPrinters call in Winspool.
.

    public struct PRINTER_INFO_2

.

        public string pPrinterName;

.

        public string pPrintProcessor;

.

    Private Structure PRINTER_INFO_2

.

        Public pPrinterName As String

.

        Public pPrintProcessor As String

.

public PRINTER_ATTRIBUTES Attributes;

.

See the PRINTER_ATTRIBUTES enum for more details.

.

If you only want to get or set the DEVMODE struct, you can use the PRINTER_INFO_9 struct instead.

.
Documentation
[PRINTER_INFO_2] on MSDN
.
Summary
Used by the EnumPrinters call in Winspool.
.

    public struct PRINTER_INFO_5

.

        public string pPrinterName;

.

Structure PRINTER_INFO_5

.

public PRINTER_ATTRIBUTES Attributes;

.

See the PRINTER_ATTRIBUTES enum for more details.

.
Documentation
[PRINTER_INFO_5] on MSDN
.
Summary
.

/// The PRINTER_INFO_9 structure specifies the per-user default printer settings.

.

internal class PRINTER_INFO_9

.

   /// default printer data such as the paper orientation and the resolution.

.
Documentation
[PRINTER_INFO_9] on MSDN
.

     ushort PrintNameOffset;

.

     ushort PrintNameLength;

.

       (4 * sizeof(ushort)) + SubstituteNameLength + PrintNameLength +

.

PrintNameOffset

.

    Offset, in bytes, of the print name string in the PathBuffer array.

.

PrintNameLength

.

    Length, in bytes, of the print name string. If this string is null-terminated,

.

    PrintNameLength does not include space for the null character.

.

    the substitute name string and print name string.

.

  internal ushort PrintNameOffset;

.

  internal ushort PrintNameLength;

.

    internal ushort PrintNameOffset;

.

    internal ushort PrintNameLength;

.

        rdb.PrintNameOffset = (ushort)(targetLenBytes + 2);

.
Summary
Informs the print spooler that a document is to be spooled for printing.
.

[DllImport("winspool.drv", EntryPoint="StartDocPrinterW", SetLastError=true,

.

private static extern uint StartDocPrinter(

.

  IntPtr hPrinter,

.

[DllImport("winspool.drv", EntryPoint="StartDocPrinterA", SetLastError=true,

.

private static extern uint StartDocPrinter(

.

  IntPtr hPrinter,

.

Structure StartDocPrinter

.

  Public Function StartDocPrinter(hPrinter As IntPtr, Level As Integer, ByRef pDocInfo As DOC_INFO_1W) As Long

.

  Public Function StartDocPrinter(hPrinter As IntPtr, Level As Integer, ByRef pDocInfo As DOC_INFO_1A) As Long

.
Documentation
[StartDocPrinter] on MSDN

msvcrt

.

static extern int sprintf(

.

static extern int swprintf(

.

static extern int sprintf([In,Out]StringBuilder buffer, String fmt,

.

static extern int sprintf([In,Out]StringBuilder buffer, String fmt,

.

static extern int sprintf([In,Out]StringBuilder buffer, String fmt,

.

  Public Shared Function sprintf(ByVal TargetString As System.Text.StringBuilder,

.

swprintf(buffer, "Greetings from thread %d\n", __arglist(Thread.CurrentThread.ManagedThreadId));

.
VB.NET
Investigate the use of System.Text.StringBuilder.AppendFormat before using sprintf.
.
Documentation
[sprintf] on MSDN

iphlpapi

.

        IF_TYPE_ISO88025_CRFPRINT = 98,  // ISO 802.5 CRFP

rapi

.

    wsprintf( outBuffer, _T("This is just a Test!") );

winfax

.

static extern bool FaxPrintCoverPage (ref FAX_CONTEXT_INFO FaxContextInfo,

.

Declare Function FaxPrintCoverPage Lib "winfax.dll" (TODO) As TODO

.
Documentation
[FaxPrintCoverPage] on MSDN
.
Summary
Starts printing an outbound fax transmission.
.

static extern bool FaxStartPrintJob (string PrinterName,

.

   ref FAX_PRINT_INFO PrintInfo, out int FaxJobId,

.

Declare Function FaxStartPrintJob Lib "winfax.dll" (TODO) As TODO

.
Documentation
[FaxStartPrintJob] on MSDN
.

private struct FAX_PRINT_INFO

.

} // FAXPRINT_INFO

.
Documentation
[FAX_PRINT_INFO] on MSDN

winspool

.
Summary
.

static extern int AbortPrinter(IntPtr hPrinter);

.
Summary
.

    internal static extern bool AddPrinterConnection(String pszBuffer);

.

Declare Function AddPrinterConnection Lib "winspool.dll" (TODO) As TODO

.
Documentation
[AddPrinterConnection] on MSDN
.
Summary
.

    internal static extern bool AddPrinterConnection(String pszBuffer);

.

Declare Function AddPrinterConnection Lib "winspool.dll" (TODO) As TODO

.
Documentation
[AddPrinterConnection] on MSDN
.
Summary
Closes a printer connection given a handle
.

static extern int ClosePrinter(IntPtr hPrinter);        

.

<DllImport("winspool.drv", EntryPoint:="ClosePrinter", _

.

Private Shared Function ClosePrinter(ByVal hPrinter As Int32) As Boolean

.
Documentation
[ClosePrinter] on MSDN
.
Summary
DeletePrinterConnection - disconnect / remove client connection to a shared printer
.

internal static extern bool DeletePrinterConnection(String pName);

.

Declare Function DeletePrinterConnection Lib "winspool.dll" (TODO) As TODO

.

result = DeletePrinterConnection("\\\\Server_Name\\Printer_Share");

.
Documentation
[DeletePrinterConnection] on MSDN
.
Summary
Brings up a printer properties page
.

static extern int DocumentProperties(IntPtr hwnd, IntPtr hPrinter, [MarshalAs(UnmanagedType.LPWStr)] string pDeviceName, IntPtr pDevModeOutput, IntPtr pDevModeInput, int fMode);

.

static extern int DocumentProperties(IntPtr hWnd, IntPtr hPrinter, string pDeviceName, IntPtr pDevModeOutput, IntPtr pDevModeInput, fModes fMode);

.

    Private Shared Function DocumentProperties(ByVal hwnd As IntPtr, ByVal hPrinter As IntPtr, <MarshalAs(UnmanagedType.LPWStr)> ByVal pDeviceName As String, ByVal pDevModeOutput As IntPtr, ByVal pDevModeInput As IntPtr, ByVal fMode As Integer) As Integer

.

"DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, pDevMode, pDevMode, 0);" returns -1 and error code 183 under x64 however i dnt knw y!

.

in order to get it working use "DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, IntPtr.Zero, pDevMode, 0);"

.

Obtain a pointer to the DEVMODE struct (either printerHandle or printerName can be NULL | IntPtr.ZERO):

.

public IntPtr GetDevMode(IntPtr printerHandle, string printerName)

.

   int sizeNeeded = DocumentProperties(IntPtr.Zero, printerHandle, printerName, IntPtr.Zero, IntPtr.Zero, fModes.DM_SIZEOF);

.

   int result = DocumentProperties(IntPtr.Zero, printerHandle, printerName, pdevmode, IntPtr.Zero, fModes.DM_OUT_BUFFER);

.

    private void OpenPrinterPropertiesDialog(PrinterSettings printerSettings)

.

        IntPtr hDevMode = printerSettings.GetHdevmode(printerSettings.DefaultPageSettings);

.

        int sizeNeeded = DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, pDevMode, pDevMode, 0);

.

        DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, devModeData, pDevMode, 14);

.

        printerSettings.SetHdevmode(devModeData);

.

        printerSettings.DefaultPageSettings.SetHdevmode(devModeData);

.

    private void OpenPrinterPropertiesDialog(PrinterSettings printerSettings)

.

        IntPtr hDevMode = printerSettings.GetHdevmode(printerSettings.DefaultPageSettings);

.

        int sizeNeeded = DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, pDevMode, pDevMode, 0);

.

        DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, IntPtr.Zero, pDevMode, 14);

.

        printerSettings.SetHdevmode(devModeData);

.

        printerSettings.DefaultPageSettings.SetHdevmode(devModeData);

.

    private void OpenPrinterPropertiesDialog(PrinterSettings printerSettings)

.

        IntPtr hDevMode = printerSettings.GetHdevmode(printerSettings.DefaultPageSettings);

.

        int sizeNeeded = DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, IntPtr.Zero, pDevMode, 0);

.

        DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, IntPtr.Zero, pDevMode, 14);

.

        printerSettings.SetHdevmode(devModeData);

.

        printerSettings.DefaultPageSettings.SetHdevmode(devModeData);

.

I had to fixed Matthias solution, because it doesn't work well for me. Exception is no more occurs, but when some setting is changed in printer properties it isn't used by printer. I've changed second call of DocumentProperties method. The third-from-last paramter MUST be in this case devModeData.

.

    private void OpenPrinterPropertiesDialog(PrinterSettings printerSettings)

.

        IntPtr hDevMode = printerSettings.GetHdevmode(printerSettings.DefaultPageSettings);

.

        int sizeNeeded = DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, IntPtr.Zero, pDevMode, 0);

.

        DocumentProperties(this.Handle, IntPtr.Zero, printerSettings.PrinterName, devModeData, pDevMode, 14);

.

        printerSettings.SetHdevmode(devModeData);

.

        printerSettings.DefaultPageSettings.SetHdevmode(devModeData);

.

Agreed that the use of a IntPrt.Zero where a recipient data structure is expected looks wrong, but it should be ok in this case: that first call to DocumentProperties does not attempt to save any data to the DevMode structure, it just returns the size of memory necessary to hold all the devModeData held by the printer driver, nothing else.

.

    /// structure contains printer driver information

.

        /// A pointer to a null-terminated string that specifies a language monitor (for example, "PJL monitor"). This member can be NULL and should be specified only for printers capable of bidirectional communication.

.

        /// A pointer to a null-terminated string that specifies the default data type of the print job (for example, "EMF").

.

        /// A pointer to a null-terminated string that specifies previous printer driver names that are compatible with this driver. For example, OldName1\0OldName2\0\0.

.

        /// Pointer to a null-terminated string that specifies the hardware ID for the printer driver.

.

        /// Pointer to a null-terminated string that specifies the provider of the printer driver (for example, "Microsoft Windows 2000")

.
Summary
Contains printer driver information.
.

        public string pszPrintProcessor;

.

        uint dwPrinterDriverAttributes;

.
Summary
.

static extern int EndDocPrinter(IntPtr hPrinter);

.
Summary
.

static extern int EndPagePrinter(IntPtr hPrinter);

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: