用程式設定列印紙張型別 (轉)

worldblog發表於2007-12-02
用程式設定列印紙張型別 (轉)[@more@]var
  Device:Array[0..cchDeviceName-1] of Char;
  :Array[0..(MAX_PATH-1)] of Char;
  Port:Array[0..32] of Char;
  hDMode:THandle;
  pDMode:PDevMode;
begin
  Printer.GetPrinter(Device,Driver,Port,hDMode);
  if hDMode<>0 then
  begin
  pDMode:=GlobalLock(hDMode);
  if pDMode<>nil then
  begin
  pDMode^.dmPaperSize:=DMPAPER_A5;
  pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERSIZE;
  GlobalUnLock(hDMode);
  end;
  end;
end;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-987256/,如需轉載,請註明出處,否則將追究法律責任。

相關文章