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

PRINTER_DEFAULTS (Structures)
 
.
Summary
Summary
Specifies the default data type, environment, initialization data, and access rights for a printer.

C# Definition:

[StructLayout(LayoutKind.Sequential)]
struct PRINTER_DEFAULTS {
   public IntPtr pDatatype;
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
class PRINTER_DEFAULTS {
   public string pDatatype;
   public IntPtr pDevMode;
   public int DesiredAccess;
   public uint DesiredAccess;
}

VB Definition:

Structure PRINTER_DEFAULTS
   Public pDatatype As IntPtr
   Public pDevMode As IntPtr
   Public DesiredAccess As Integer
End Structure

User-Defined Field Types:

None.

/// <summary>
/// The PRINTER_DEFAULTS structure specifies the default data type,
/// environment, initialization data, and access rights for a printer.
/// </summary>
/// <seealso href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd162839(v=vs.85).aspx"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal class PRINTER_DEFAULTS
{
   /// <summary>
   /// Pointer to a null-terminated string that specifies the
   /// default data type for a printer.
   /// </summary>
   public IntPtr pDatatype;

   /// <summary>
   /// Pointer to a DEVMODE structure that identifies the
   /// default environment and initialization data for a printer.
   /// </summary>
   public IntPtr pDevMode;

   /// <summary>
   /// 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.
   /// </summary>
   public ACCESS_MASK DesiredAccess;
}

VB Definition:

Structure PRINTER_DEFAULTS
   Public pDatatype As IntPtr
   Public pDevMode As IntPtr
   Public DesiredAccess As Integer
End Structure

User-Defined Field Types:

If you don't have an enum ACCESS_MASK defined, use

public int DesiredAccess;

instead.

Notes:

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

PRINTER_DEFAULTS should be defined as a class instead of a struct, so that OpenPrinter does not need pDefaults to be passed in as a ref argument, thus you can pass in null if you want to.

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

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