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 "PRINTER_DEFAULTS" in [All]

Structures

.

struct PRINTER_DEFAULTS {

.

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

.

internal class PRINTER_DEFAULTS

.

Structure PRINTER_DEFAULTS

.
Documentation
[PRINTER_DEFAULTS] on MSDN

winspool

.

static extern int OpenPrinter(string pPrinterName, out IntPtr phPrinter, ref PRINTER_DEFAULTS pDefault);

.

Both signatures will work fine, it is a matter of whether you need a higher level of access to the printer or not. For 'read' only access such as monitoring printer queues, you don't need to pass in a PRINTER_DEFAULTS instance for the last parameter, you can just pass zero (0) if you declare the extern function pDefault parameter as an int. You will need a PRINTER_DEFAULTS structure if you need to change any properties of the printer such as setting the duplex value of the printer.

.

If you use the class-version of PRINTER_DEFAULTS, this declaration will be useful (no ref needed, because it is a class):

.

static extern unsafe bool OpenPrinter(string pPrinterName, out IntPtr phPrinter, PRINTER_DEFAULTS pDefault);

.

   ByRef hPrinter As IntPtr, ByVal pDefault As PRINTER_DEFAULTS) As Boolean

.

   ByRef hPrinter As IntPtr, ByRef pDefault As PRINTER_DEFAULTS) As Boolean

.

   IntPtr& phPrinter, PRINTER_DEFAULTS& pDefault)

.

PRINTER_DEFAULTS

.

PRINTER_DEFAULTS defaults = new PRINTER_DEFAULTS();

.

private static extern bool ResetPrinter(IntPtr hPrinter,ref PRINTER_DEFAULTS pd);

.

PRINTER_DEFAULTS

.

Used by sample code: PRINTER_DEFAULTS

.

PRINTER_DEFAULTS defaults = new PRINTER_DEFAULTS();

.

PRINTER_DEFAULTS

.

     PRINTER_DEFAULTS Defaults = new PRINTER_DEFAULTS();


 
Access PInvoke.net directly from VS: