精华内容
下载资源
问答
  • Winspool.h

    2012-04-10 12:21:31
    打印 winspool drv 打印函数库打印 winspool drv 打印函数库打印 winspool drv 打印函数库
  • winspool.dll

    2008-10-29 10:44:25
    winspool.dll 分享 打印机
  • 打印管理库函数 winspool.drv (全部API完)
  • winspool.drv

    2015-01-07 16:57:00
    public partial class Form1 : Form{ [System.Runtime.InteropServices.DllImportAttribute("winspool.drv", SetLastError = true)] public extern static int DocumentProperties( In...
    public partial class Form1 : Form
    { [System.Runtime.InteropServices.DllImportAttribute(
    "winspool.drv", SetLastError = true)] public extern static int DocumentProperties( IntPtr hWnd, // handle to parent window IntPtr hPrinter, // handle to printer object string pDeviceName, // device name ref IntPtr pDevModeOutput, // modified device mode ref IntPtr pDevModeInput, // original device mode int fMode); // mode options [System.Runtime.InteropServices.DllImportAttribute("winspool.drv")] public static extern int PrinterProperties( IntPtr hwnd, // handle to parent window IntPtr hPrinter); // handle to printer object [System.Runtime.InteropServices.DllImportAttribute("winspool.drv", SetLastError = true)] public extern static int OpenPrinter( string pPrinterName, // printer name ref IntPtr hPrinter, // handle to printer object ref IntPtr pDefault); // handle to default printer object. [System.Runtime.InteropServices.DllImportAttribute("winspool.drv", SetLastError = true)] public static extern int ClosePrinter( IntPtr phPrinter); // handle to printer object public Form1() { InitializeComponent(); }
    /// <summary>
    /// 调用API打开打印机属性窗口
    /// </summary>
    private void button1_Click(object sender, EventArgs e) { string printerName = "ZEBRA R110Xi4 300DPI"; if (printerName != null && printerName.Length > 0) { IntPtr pPrinter = IntPtr.Zero; IntPtr pDevModeOutput = IntPtr.Zero; IntPtr pDevModeInput = IntPtr.Zero; IntPtr nullPointer = IntPtr.Zero; OpenPrinter(printerName, ref pPrinter, ref nullPointer); int iNeeded = PrinterProperties(this.Handle, pPrinter); ClosePrinter(pPrinter); } }
    ///<summary>
    ///调用API打开Document property窗口
    ///</summary>
    private void button2_Click(object sender, EventArgs e) { string printerName = "ZEBRA R110Xi4 300DPI"; if (printerName != null && printerName.Length > 0) { IntPtr pPrinter = IntPtr.Zero; IntPtr pDevModeOutput = IntPtr.Zero; IntPtr pDevModeInput = IntPtr.Zero; IntPtr nullPointer = IntPtr.Zero; OpenPrinter(printerName, ref pPrinter, ref nullPointer); int iNeeded = DocumentProperties(this.Handle, pPrinter, printerName, ref pDevModeOutput, ref pDevModeInput, 0); pDevModeOutput = System.Runtime.InteropServices.Marshal.AllocHGlobal(iNeeded); DocumentProperties(this.Handle, pPrinter, printerName, ref pDevModeOutput, ref pDevModeInput, 14); ClosePrinter(pPrinter); } } }

     

    转载于:https://www.cnblogs.com/JustYong/p/4208869.html

    展开全文
  • 带SetDefaultPrinter的winspool头文件和库文件,覆盖原来的winspool.h和winspool.lib即可。
  • winspool.drv实现的打印预览

    热门讨论 2008-09-25 00:08:22
    winspool.drv实现的打印预览 winspool.drv常用方法的使用
  • 打印管理库函数Winspool.drv 打印机底层驱动的包 函数名称说明AbortPrinter 删除打印机的假脱机文件AddForm 向可被选择用于给定打印机的格式表中添加一格式AddJob ...

    打印机底层驱动的包

    函数名称                         说明
    AbortPrinter                    删除打印机的假脱机文件
    AddForm                        向可被选择用于给定打印机的格式表中添加一格式
    AddJob                          返回一个可用来存储打印工作的文件的完整路径和文件名
    AddMonitor                    安装一个本机打印机监视器,并连接配置文件 、数据文件和监视器文件
    AddPort                         向支持的端口列表中添加一端口名
    AddPrinter                     向指定的服务器所支持的打印机列表中添加一 打印机
    AddPrinterConnection   为当前用户添加指定的打印机并连接
    AddPrinterDriver            安装一本地或远程打印机并连接培植文件、数据文件和驱动文件
    AddPrintProcessor         在指定的服务器上安装一打印处理程序,并将它的名称添加到所支持的内部列表中
    AddPrintProvidor            安装一本地打印机提供程序,并连接配置文件、数据文件和提供程序文件
    AdvancedDocumentProperties    为给定的打印机显示一个打印机高级配置对话框,以允许进行配置
    ClosePrinter                   关闭给定的打印机对象
    ConfigurePort                 显示指定服务器上给定端口的配置对话框,以允许进行配置
    ConnectToPrinterDlg      显示一对话框供用户在网络浏览并连接打印机
    DeleteForm                    从所支持的格式表中删除一个格式名
    DeleteMonitor                 删除一个由AddMonitor函数所添加的打印机监视器
    DeleteProt                      显示一对话框,以允许用户删除一个端口名
    DeletePrinter                  删除指定的打印机对象
    DeletePrinterConnection     删除指定的打印机连接
    DeletePrinterDriver             从给定服务器所支持的驱动器名称表中删除指定的打印机驱动器
    DeletePrintProcessor          删除由AddPrintProcessor函数所添加的打印机处理程序
    DeletePrintProvidor             删除由AddPrintProvidor函数所添加的提供器
    DeviceCapabilities              获取指定的打印机所需求的性能
    DocumentProperties           为给定的打印机显示一个打印机配置对话框,以允许进行配置
    EndDocPrinter                    终止给定打印机的一个打印作业
    EndPagePrinter                  指示一页的结束和下一页的开始
    EnumForms                        枚举指定打印机所支持的格式
    EnumJobs                          用描述打印机的打印作业数据初始化一个JOB_INFO_1或JOB_INFO_2结构数组,以便枚举打印机作业
    EnumMonitors                    用描述给定服务器的监视器数据初始化一个MONITOR_INFO_1结构数组,以便枚举打印机监视器
    EnumPorts                          枚举可用于在指定服务器上进行打印的端口
    EnumPrinterDrivers            枚举在给定打印机服务器上安装的所有打印机驱动程序
    EnumPrinters                     枚举指定服务器上可用的打印机
    EnumPrintProcessorDatatypes   枚举指定打印机处理程序所支持的数据类型
    EnumPrintProcessors           枚举在指定服务器上安装的打印处理器
    FindClosePrinterChangeNotification 关闭通过调用FindFirstPrinterChangeNotification函数建立的改变通知对象
    FindFirstPrinterChangeNotification 创建一个改变通知对象并返回句柄,使用该句柄在调用一个等待函数期间,检查打印机或打印服务器的变化
    FindNextPrinterChangeNotification 为与指定打印机或打印服务器相关的改变通知对象检取最近的改变通知通知信息,也可用来重新设置该改变通知对象为不发信息状态
    FreePrinterNotifyInfo         释放系统分配的由FindNextPrinterChangeNotification函数返回的缓冲区
    GetForm              利用描述给定打印机指定格式的数据初始化一个FORM_INFO_1结构
    GetJob                        检取指定打印机的打印作业数据
    GetPrinter                    检取给定打印机的数据
    GetPrinterData                检取给定打印机的配置数据
    GetPrinterDriver              检取给定打印机的驱动程序数据
    GetPrinterDriverDirectory     检取给定打印机驱动程序的目录路径
    GetPrintProcessDirectory      检取指定服务器上打印机处理程序的路径
    OpenPrinter                   检取一个标识特定打印机或打印服务器的句柄并打开
    PrinterMessageBox             显示一个消息框,供一个正打印的应用程序通知用户发生一个打印作业错误
    PrinterProperties             为给定打印机显示一个打印机性能对话框,以允许进行设置
    ReadPrinter                   从给定打印机检取数据
    ResetPrinter                  让应用程序设定有StartDocPrinter函数提交的打印文档的数据类型和设备模式值
    ScheduleJob                   通知假脱机打印程序,可为指定的作业安排打印
    SetForm                       为给定的打印机设置格式信息
    SetJob                        暂停,恢复,取消或重新启动给定打印机上指定的打印作业
    SetPrinter                    用暂停,恢复,或清除所有打印作业来设置指定的打印机
    SetPrinterData                设置一台打印机的配置数据
    StartDocPrinter               通知假脱机打印程序将在假脱机上打印一个文档
    StartPagePrinter             通知假脱机打印程序将在给定打印机上打印一页
    WritePrinter                  通知假脱机打印程序应向给定的打印机写指定的数据
    用底层的通讯命令,实现很多命令

    转载于:https://www.cnblogs.com/turnip/p/11511303.html

    展开全文
  • winspool取得本机安装的打印机的详细信息 (转)[@more@]用winspool取得本机安装的打印机的详细信息 在Delphi 6 Professional version on windows 2000 Profe...
    用winspool取得本机安装的打印机的详细信息 (转)[@more@]

    用winspool取得本机安装的打印机的详细信息

    Delphi 6 Professional version on windows 2000 Professional环境下测试过
    窗体的名字为"FPrint",有TMemo 和 TCombobox 两个控件

    unit unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, ExtCtrls, ComCtrls, TabEdit, Printers, Buttons, WinSpool;

    type
      TPrinterInfo = record
      SeverName  : PChar;
      PrinterName  : PChar;
      ShareName  : PChar;
      PortName  : PChar;
      driverName  : PChar;
      Comment  : PChar;
      Location  : PChar;
      DeviceMode  : PDeviceModeA;
      SepFile  : PChar;
      PrintProcessor  : PChar;
      DataType  : PChar;
      Parameters  : PChar;
      SecurityDescriptor: PSecurityDescriptor;
      Attributes  : Cardinal;
      DefaultPriority  : Cardinal;
      StartTime  : Cardinal;
      UntilTime  : Cardinal;
      Status  : Cardinal;
      Jobs  : Cardinal;
      AveragePPM  : Cardinal;
      end;

      TFPrint = class(TForm)
      Memo1: TMemo;
      ComboBox1: TComboBox;
      procedure FormShow(Sender: Tobject);
      procedure ComboBox1Change(Sender: TObject);
      private
      { Private declarations }
      public
      { Public declarations }
      end;

      function GetCurrentPrinterInformation: TPrinterInfo;
      function GetCurrentPrinterHandle: THandle;

    var
      FPrint: TFPrint;

    implementation

    {$R *.dfm}

    function GetCurrentPrinterHandle: THandle;
    var
      Device, Driver, Port : array[0..255] of char;
      hDeviceMode: THandle;
    begin
      Printer.GetPrinter(Device, Driver, Port, hDeviceMode);
      if not OpenPrinter(@Device, Result, nil) then
      RaiseLastwin32Error;
    end;

    function GetCurrentPrinterInformation: TPrinterInfo;
    var
      hPrinter  : THandle;
      pInfo:  PPrinterInfo2;
      bytesNeeded: Dword;
    begin
      hprinter := GetCurrentPrinterHandle;
      try
      Winspool.GetPrinter( hPrinter, 2, Nil, 0, @bytesNeeded );
      pInfo := AllocMem( bytesNeeded );
      try
      Winspool.GetPrinter( hPrinter, 2, pInfo, bytesNeeded, @bytesNeeded );
      Result.SeverName  := pInfo^.pServerName;
      Result.PrinterName  := pInfo^.pPrinterName;
      Result.ShareName  := pInfo^.pShareName;
      Result.PortName  := pInfo^.pPortName;
      Result.DriverName  := pInfo^.pDriverName;
      Result.Comment  := pInfo^.pComment;
      Result.Location  := pInfo^.pLocation;
      Result.DeviceMode  := pInfo^.pDevMode;
      Result.SepFile  := pInfo^.pSepFile;
      Result.PrintProcessor  := pInfo^.pPrintProcessor;
      Result.DataType  := pInfo^.pDatatype;
      Result.Parameters  := pInfo^.pParameters;
      Result.SecurityDescriptor := pInfo^.pSecurityDescriptor;
      Result.Attributes  := pInfo^.Attributes;
      Result.DefaultPriority  := pInfo^.DefaultPriority;
      Result.StartTime  := pInfo^.StartTime;
      Result.UntilTime  := pInfo^.UntilTime;
      Result.Status  := pInfo^.Status;
      Result.Jobs  := pInfo^.cJobs;
      Result.AveragePPM  := pInfo^.AveragePPM;
      finally
      FreeMem( pInfo );
      end;
      finally
      ClosePrinter( hPrinter );
      end;
    end;


    procedure TFPrint.FormShow(Sender: TObject);
    begin
      ComboBox1.Items.Assign(Printer.Printers);
      ComboBox1.ItemIndex := 0;
      ComboBox1.OnChange(nil);
    end;

    procedure TFPrint.ComboBox1Change(Sender: TObject);
    var
      PrinterInfo: TPrinterInfo;
    begin
      PrinterInfo := GetCurrentPrinterInformation;
      memo1.Clear;
      with memo1.Lines do
      begin
      Add('GENERAL INFORMATION');
      Add('');
      Add('ServerName: ' + PrinterInfo.SeverName);
      Add('PrinterName: ' + PrinterInfo.PrinterName);
      Add('ShareName: ' + PrinterInfo.ShareName);
      Add('PortName: ' + PrinterInfo.PortName);
      Add('DriverName: ' + PrinterInfo.DriverName);
      Add('Comment: ' + PrinterInfo.Comment);
      Add('Location: ' + PrinterInfo.Location);
      Add('SepFile: ' + PrinterInfo.SepFile);
      Add('PrintProcessor: ' + PrinterInfo.PrintProcessor);
      Add('DataType: ' + PrinterInfo.DataType);
      Add('Parameters: ' + PrinterInfo.Parameters);
      Add('Attributes: ' + IntToStr(PrinterInfo.Attributes));
      Add('DefaultPriority: ' + IntToStr(PrinterInfo.DefaultPriority));
      Add('StartTime: ' + IntToStr(PrinterInfo.StartTime));
      Add('UntilTime: ' + IntToStr(PrinterInfo.UntilTime));
      Add('Status: ' + IntToStr(PrinterInfo.Status));
      Add('Jobs: ' + IntToStr(PrinterInfo.Jobs));
      Add('AveragePPM: ' + IntToStr(PrinterInfo.AveragePPM));
      Add('');
      Add('DEVICEMODE INFORMATION');
      Add('');

      Add('DeviceName: ' + PrinterInfo.DeviceMode.dmDeviceName);
      Add('SpecVersion: ' + IntToStr(PrinterInfo.DeviceMode.dmSpecVersion));
      Add('DriverVersion: ' + IntToStr(PrinterInfo.DeviceMode.dmDriverVersion));
      Add('Size: ' + IntToStr(PrinterInfo.DeviceMode.dmSize));
      Add('DriverExtra: ' + IntToStr(PrinterInfo.DeviceMode.dmDriverExtra));
      Add('Fields: ' + IntToStr(PrinterInfo.DeviceMode.dmFields));
      Add('Orientation: ' + IntToStr(PrinterInfo.DeviceMode.dmOrientation));
      Add('PaperSize: ' + IntToStr(PrinterInfo.DeviceMode.dmPaperSize));
      Add('Paperlength: ' + IntToStr(PrinterInfo.DeviceMode.dmPaperLength));
      Add('PaperWidth: ' + IntToStr(PrinterInfo.DeviceMode.dmPaperWidth));
      Add('Scale: ' + IntToStr(PrinterInfo.DeviceMode.dmScale));
      Add('Copies: ' + IntToStr(PrinterInfo.DeviceMode.dmCopies));
      Add('Defaultsource: ' + IntToStr(PrinterInfo.DeviceMode.dmDefaultSource));
      Add('PrintQuality: ' + IntToStr(PrinterInfo.DeviceMode.dmPrintQuality));
      Add('Color: ' + IntToStr(PrinterInfo.DeviceMode.dmColor));
      Add('Duplex: ' + IntToStr(PrinterInfo.DeviceMode.dmDuplex));
      Add('YResolution: ' + IntToStr(PrinterInfo.DeviceMode.dmYResolution));
      Add('TTOption: ' + IntToStr(PrinterInfo.DeviceMode.dmTTOption));
      Add('Collate: ' + IntToStr(PrinterInfo.DeviceMode.dmCollate));
      Add('LogPixels: ' + IntToStr(PrinterInfo.DeviceMode.dmLogPixels));
      Add('BitsPerPel: ' + IntToStr(PrinterInfo.DeviceMode.dmBitsPerPel));
      Add('PelsWidth: ' + IntToStr(PrinterInfo.DeviceMode.dmPelsWidth));
      Add('PelsHeight: ' + IntToStr(PrinterInfo.DeviceMode.dmPelsHeight));
      Add('DisplayFlags: ' + IntToStr(PrinterInfo.DeviceMode.dmDisplayFlags));
      Add('DisplayFrequency: ' + IntToStr(PrinterInfo.DeviceMode.dmDisplayFrequency));
      Add('ICMMethod: ' + IntToStr(PrinterInfo.DeviceMode.dmICMMethod));
      Add('ICMintent: ' + IntToStr(PrinterInfo.DeviceMode.dmICMIntent));
      Add('MediaType: ' + IntToStr(PrinterInfo.DeviceMode.dmMediaType));
      Add('DitherType: ' + IntToStr(PrinterInfo.DeviceMode.dmDitherType));
      Add('ICCManufacturer: ' + IntToStr(PrinterInfo.DeviceMode.dmICCManufacturer));
      Add('ICCModel: ' + IntToStr(PrinterInfo.DeviceMode.dmICCModel));
      Add('PanningWidth: ' + IntToStr(PrinterInfo.DeviceMode.dmPanningWidth));
      Add('PanningHeight: ' + IntToStr(PrinterInfo.DeviceMode.dmPanningHeight));
      end;
    end;

    end.
    //rock
    //转载请保留此信息


    来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10748419/viewspace-1003093/,如需转载,请注明出处,否则将追究法律责任。

    转载于:http://blog.itpub.net/10748419/viewspace-1003093/

    展开全文
  • <p>I needed basic printing functionality to print PDFs at variable page sizes. I was able to get this to work with the following code I just posted ...
  • winspool取得本机安装的打印机的详细信息在Delphi 6 Professional version on Windows 2000 Professional环境下测试过窗体的名字为"FPrint",有TMemo 和 TCombobox 两个控件unit unit1; interface uses Windows, ...

    用winspool取得本机安装的打印机的详细信息

    在Delphi 6 Professional version on Windows 2000 Professional环境下测试过
    窗体的名字为"FPrint",有TMemo 和 TCombobox 两个控件

    unit unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, ExtCtrls, ComCtrls, TabEdit, Printers, Buttons, WinSpool;

    type
      TPrinterInfo = record
        SeverName         : PChar;
        PrinterName       : PChar;
        ShareName         : PChar;
        PortName          : PChar;
        DriverName        : PChar;
        Comment           : PChar;
        Location          : PChar;
        DeviceMode        : PDeviceModeA;
        SepFile           : PChar;
        PrintProcessor    : PChar;
        DataType          : PChar;
        Parameters        : PChar;
        SecurityDescriptor: PSecurityDescriptor;
        Attributes        : Cardinal;
        DefaultPriority   : Cardinal;
        StartTime         : Cardinal;
        UntilTime         : Cardinal;
        Status            : Cardinal;
        Jobs              : Cardinal;
        AveragePPM        : Cardinal;
      end;

      TFPrint = class(TForm)
        Memo1: TMemo;
        ComboBox1: TComboBox;
        procedure FormShow(Sender: TObject);
        procedure ComboBox1Change(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

      function GetCurrentPrinterInformation: TPrinterInfo;
      function GetCurrentPrinterHandle: THandle;

    var
      FPrint: TFPrint;

    implementation

    {$R *.dfm}

    function GetCurrentPrinterHandle: THandle;
    var
      Device, Driver, Port : array[0..255] of char;
      hDeviceMode: THandle;
    begin
      Printer.GetPrinter(Device, Driver, Port, hDeviceMode);
      if not OpenPrinter(@Device, Result, nil) then
        RaiseLastWin32Error;
    end;

    function GetCurrentPrinterInformation: TPrinterInfo;
    var
      hPrinter  : THandle;
      pInfo:  PPrinterInfo2;
      bytesNeeded: DWORD;
    begin
      hprinter := GetCurrentPrinterHandle;
      try
        Winspool.GetPrinter( hPrinter, 2, Nil, 0, @bytesNeeded );
        pInfo := AllocMem( bytesNeeded );
        try
          Winspool.GetPrinter( hPrinter, 2, pInfo, bytesNeeded, @bytesNeeded );
           Result.SeverName          := pInfo^.pServerName;
           Result.PrinterName        := pInfo^.pPrinterName;
           Result.ShareName          := pInfo^.pShareName;
           Result.PortName           := pInfo^.pPortName;
           Result.DriverName         := pInfo^.pDriverName;
           Result.Comment            := pInfo^.pComment;
           Result.Location           := pInfo^.pLocation;
           Result.DeviceMode         := pInfo^.pDevMode;
           Result.SepFile            := pInfo^.pSepFile;
           Result.PrintProcessor     := pInfo^.pPrintProcessor;
           Result.DataType           := pInfo^.pDatatype;
           Result.Parameters         := pInfo^.pParameters;
           Result.SecurityDescriptor := pInfo^.pSecurityDescriptor;
           Result.Attributes         := pInfo^.Attributes;
           Result.DefaultPriority    := pInfo^.DefaultPriority;
           Result.StartTime          := pInfo^.StartTime;
           Result.UntilTime          := pInfo^.UntilTime;
           Result.Status             := pInfo^.Status;
           Result.Jobs               := pInfo^.cJobs;
           Result.AveragePPM         := pInfo^.AveragePPM;
        finally
          FreeMem( pInfo );
        end;
      finally
        ClosePrinter( hPrinter );
      end;
    end;


    procedure TFPrint.FormShow(Sender: TObject);
    begin
      ComboBox1.Items.Assign(Printer.Printers);
      ComboBox1.ItemIndex := 0;
      ComboBox1.OnChange(nil);
    end;

    procedure TFPrint.ComboBox1Change(Sender: TObject);
    var
      PrinterInfo: TPrinterInfo;
    begin
      PrinterInfo := GetCurrentPrinterInformation;
      memo1.Clear;
      with memo1.Lines do
      begin
        Add('GENERAL INFORMATION');
        Add('');
        Add('ServerName: ' + PrinterInfo.SeverName);
        Add('PrinterName: ' + PrinterInfo.PrinterName);
        Add('ShareName: ' + PrinterInfo.ShareName);
        Add('PortName: ' + PrinterInfo.PortName);
        Add('DriverName: ' + PrinterInfo.DriverName);
        Add('Comment: ' + PrinterInfo.Comment);
        Add('Location: ' + PrinterInfo.Location);
        Add('SepFile: ' + PrinterInfo.SepFile);
        Add('PrintProcessor: ' + PrinterInfo.PrintProcessor);
        Add('DataType: ' + PrinterInfo.DataType);
        Add('Parameters: ' + PrinterInfo.Parameters);
        Add('Attributes: ' + IntToStr(PrinterInfo.Attributes));
        Add('DefaultPriority: ' + IntToStr(PrinterInfo.DefaultPriority));
        Add('StartTime: ' + IntToStr(PrinterInfo.StartTime));
        Add('UntilTime: ' + IntToStr(PrinterInfo.UntilTime));
        Add('Status: ' + IntToStr(PrinterInfo.Status));
        Add('Jobs: ' + IntToStr(PrinterInfo.Jobs));
        Add('AveragePPM: ' + IntToStr(PrinterInfo.AveragePPM));
        Add('');
        Add('DEVICEMODE INFORMATION');
        Add('');

        Add('DeviceName: ' + PrinterInfo.DeviceMode.dmDeviceName);
        Add('SpecVersion: ' + IntToStr(PrinterInfo.DeviceMode.dmSpecVersion));
        Add('DriverVersion: ' + IntToStr(PrinterInfo.DeviceMode.dmDriverVersion));
        Add('Size: ' + IntToStr(PrinterInfo.DeviceMode.dmSize));
        Add('DriverExtra: ' + IntToStr(PrinterInfo.DeviceMode.dmDriverExtra));
        Add('Fields: ' + IntToStr(PrinterInfo.DeviceMode.dmFields));
        Add('Orientation: ' + IntToStr(PrinterInfo.DeviceMode.dmOrientation));
        Add('PaperSize: ' + IntToStr(PrinterInfo.DeviceMode.dmPaperSize));
        Add('PaperLength: ' + IntToStr(PrinterInfo.DeviceMode.dmPaperLength));
        Add('PaperWidth: ' + IntToStr(PrinterInfo.DeviceMode.dmPaperWidth));
        Add('Scale: ' + IntToStr(PrinterInfo.DeviceMode.dmScale));
        Add('Copies: ' + IntToStr(PrinterInfo.DeviceMode.dmCopies));
        Add('DefaultSource: ' + IntToStr(PrinterInfo.DeviceMode.dmDefaultSource));
        Add('PrintQuality: ' + IntToStr(PrinterInfo.DeviceMode.dmPrintQuality));
        Add('Color: ' + IntToStr(PrinterInfo.DeviceMode.dmColor));
        Add('Duplex: ' + IntToStr(PrinterInfo.DeviceMode.dmDuplex));
        Add('YResolution: ' + IntToStr(PrinterInfo.DeviceMode.dmYResolution));
        Add('TTOption: ' + IntToStr(PrinterInfo.DeviceMode.dmTTOption));
        Add('Collate: ' + IntToStr(PrinterInfo.DeviceMode.dmCollate));
        Add('LogPixels: ' + IntToStr(PrinterInfo.DeviceMode.dmLogPixels));
        Add('BitsPerPel: ' + IntToStr(PrinterInfo.DeviceMode.dmBitsPerPel));
        Add('PelsWidth: ' + IntToStr(PrinterInfo.DeviceMode.dmPelsWidth));
        Add('PelsHeight: ' + IntToStr(PrinterInfo.DeviceMode.dmPelsHeight));
        Add('DisplayFlags: ' + IntToStr(PrinterInfo.DeviceMode.dmDisplayFlags));
        Add('DisplayFrequency: ' + IntToStr(PrinterInfo.DeviceMode.dmDisplayFrequency));
        Add('ICMMethod: ' + IntToStr(PrinterInfo.DeviceMode.dmICMMethod));
        Add('ICMintent: ' + IntToStr(PrinterInfo.DeviceMode.dmICMIntent));
        Add('MediaType: ' + IntToStr(PrinterInfo.DeviceMode.dmMediaType));
        Add('DitherType: ' + IntToStr(PrinterInfo.DeviceMode.dmDitherType));
        Add('ICCManufacturer: ' + IntToStr(PrinterInfo.DeviceMode.dmICCManufacturer));
        Add('ICCModel: ' + IntToStr(PrinterInfo.DeviceMode.dmICCModel));
        Add('PanningWidth: ' + IntToStr(PrinterInfo.DeviceMode.dmPanningWidth));
        Add('PanningHeight: ' + IntToStr(PrinterInfo.DeviceMode.dmPanningHeight));
      end;
    end;

    end.
    //rock
    //转载请保留此信息

    展开全文
  • 最后在网上找到一种使用winspool.Drv驱动标Zebra标签机的方法,能够使用ZPII编程语言驱动标签机,才算是圆满解决问题了。    驱动类  RawPrinterHelper 1 using System; 2 using System....
  • 调用winspool.Drv传输斑马条码打印机的指令打印速度慢,代码照搬:http://support.microsoft.com/kb/322091 指令字符串如下: ^MUD,200,200 ^XA ^PRC ^LH0,0^FS ^LL160 ^PW400 ^MD0 ^MNY ^LH0,0^FS ^BY1,...
  • 我想做个打印的helloworld程序,出现以下报错。各位大神帮我看看。谢谢了![img=https://img-bbs.csdn.net/upload/201901/26/1548487458_8989.jpg][/img][img=...[/img]
  • 用codeblock编译器,winspool头文件中的函数。 结果出现一堆连接错误。 undefined reference to SetPrinterA@16 undefined reference to ClosePrinter@4 等等。 既然编辑器提供了winspool的头文件,那么连接问题不...
  • C# 如何设置系统的默认打印机

    千次阅读 2013-10-23 12:29:04
    using System.Runtime.InteropServices;...[DllImport("winspool.drv")] public static extern bool SetDefaultPrinter(string Name); private void button1_Click(object sender, EventArgs e) {  
  • CreateWindowEx.zip

    2019-07-24 17:02:58
    winspool hook createwindowexwc ++原码,适用于破解补丁
  • USB连接斑马打印机。VC++用ZPL命令打印条形码,调用winspool中接口(目前常见的是C#代码,但其实也是调用winspool中接口)。试验打印机为GT800.
  • VC++打印ZPL条形码。GT800;USB连接斑马打印机。 USB连接斑马打印机。VC++用ZPL命令打印条形码,调用winspool中接口(目前常见的是C#代码,但其实也是调用winspool中接口)。试验打印机为GT800. C++;ZPL;USB;
  • WinDbg 调试笔记

    2019-04-25 12:57:13
    sxe ld:Winspool.drv bp WINSPOOL!AddPrinterW bp WINSPOOL!AddPrinterA VS编译时需要将/pdbtype:sept编译选项去掉,dv才有结构体信息 //设定符号文件路径到本地及微软服务器: .sympath SRV*H:/S...
  • Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\winspool.lib: Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\comdlg32.lib: Searching C:\Program Files\Microsoft SDKs\...
  • VC++访问打印机

    2018-11-02 13:38:20
    WinSpool.h&gt; #pragma comment(lib, "Winspool.lib")   得到电脑的默认打印机、设置默认打印机、遍历电脑打印机GetDefaultPrinter,SetDefaultPrinter,EnumPrinters。 得到电脑的默认打印机: ...
  • 直接上代码: 需包含头文件如下: #include "...WinSpool.h&gt; #pragma comment(lib, "Winspool.lib")   void ShowPrinterStatus() { HANDLE printerHandle; //打印机设备句柄 ...
  • 直接上代码: 需包含头文件 ...WinSpool.h&gt; #pragma comment(lib, "Winspool.lib")     int FindChangeNotification() { HANDLE hPrinter; PRINTER_DEFAULTS pDefault; ...
  • 直接上代码: 需包含头文件 ...WinSpool.h&gt; #pragma comment(lib, "Winspool.lib")     int findPrint() { DWORD i ; DWORD dwSize; DWORD dwPrinters; LPHANDLE phP...
  • 【C#】设置计算机的默认打印机

    千次阅读 2019-05-20 15:51:44
    [DllImport("winspool.drv")] public static extern bool SetDefaultPrinter(string Name);

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 2,502
精华内容 1,000
关键字:

winspool