J
jialiguo
Unregistered / Unconfirmed
GUEST, unregistred user!
var
Device: Array[0..(cchDeviceName -1)] of char;
Driver: Array[0..(MAX_PATH -1)] of char;
Port: Array[0..32] of char;
HDMode : THandle;
PDMode: PDevMode;
begin
try
if PrinterSetupDialog1.Execute then
begin
Printer.PrinterIndex := Printer.PrinterIndex ;
Printer.GetPrinter(Device,Driver,Port,HDMode);
if HDMode <> 0 then
begin
PDMode := GlobalLock(HDMode);
if PDMode <> nil then
begin
print_Para.dmPaperSize := pDMode.dmPaperSize;
print_Para.dmOrientation := pDMode.dmOrientation ;
end;
GlobalUnLock(HDMode);
end;
end;
except
end;
比如我这次设置了打印是按A3打,当我下次上系统的时候就直接显示是A3了,而显示默认的A3
Device: Array[0..(cchDeviceName -1)] of char;
Driver: Array[0..(MAX_PATH -1)] of char;
Port: Array[0..32] of char;
HDMode : THandle;
PDMode: PDevMode;
begin
try
if PrinterSetupDialog1.Execute then
begin
Printer.PrinterIndex := Printer.PrinterIndex ;
Printer.GetPrinter(Device,Driver,Port,HDMode);
if HDMode <> 0 then
begin
PDMode := GlobalLock(HDMode);
if PDMode <> nil then
begin
print_Para.dmPaperSize := pDMode.dmPaperSize;
print_Para.dmOrientation := pDMode.dmOrientation ;
end;
GlobalUnLock(HDMode);
end;
end;
except
end;
比如我这次设置了打印是按A3打,当我下次上系统的时候就直接显示是A3了,而显示默认的A3