Desktop Functions: Smart Device Functions:
|
Search Results for "PRINTER_DEFAULTS" in [All]winspool1: OpenPrinter
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 defaults = new PRINTER_DEFAULTS(); 2: ResetPrinter
private static extern bool ResetPrinter(IntPtr hPrinter,ref PRINTER_DEFAULTS pd); 3: SetJob Used by sample code: PRINTER_DEFAULTS
PRINTER_DEFAULTS defaults = new PRINTER_DEFAULTS(); 4: XcvData
PRINTER_DEFAULTS Defaults = new PRINTER_DEFAULTS(); Structures |