T
tangkd
Unregistered / Unconfirmed
GUEST, unregistred user!
我用以下函数设置打印页面大小,在Win2K上一切正常,而在Win98上页面设置
没有任何作用,哪位大虾可以告诉我为什么,感谢!
function SetPage: Boolean;
var
DeviceHandle:THandle;
PDModeDeviceMode;
ADevice,ADriver,APort:array[0..255] of char;
begin
Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
if DeviceHandle=0 then
begin
MessageBox(Application.Handle,'无法初始化打印机','提示信息',MB_OK+MB_ICONWARNING);
Result:=False;
exit;
end;
try
PDMode:=GlobalLock(DeviceHandle);
with PDMode^do
begin
dmFields:=dmFields or DM_PAPERSIZE ;
dmPaperSIZE:=0;
dmFields:=dmFields or DM_PAPERWIDTH ;
dmPaperWidth:=2130;//Trunc(2130/254*PixelsInInchX);
dmFields:=dmFields or DM_PAPERLENGTH ;
dmPaperLength:=1019;//Trunc(1020/254*PixelsInInchY);
end;
finally
GlobalUnLock(DeviceHandle);
end;
Result:=True;
end;
没有任何作用,哪位大虾可以告诉我为什么,感谢!
function SetPage: Boolean;
var
DeviceHandle:THandle;
PDModeDeviceMode;
ADevice,ADriver,APort:array[0..255] of char;
begin
Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
if DeviceHandle=0 then
begin
MessageBox(Application.Handle,'无法初始化打印机','提示信息',MB_OK+MB_ICONWARNING);
Result:=False;
exit;
end;
try
PDMode:=GlobalLock(DeviceHandle);
with PDMode^do
begin
dmFields:=dmFields or DM_PAPERSIZE ;
dmPaperSIZE:=0;
dmFields:=dmFields or DM_PAPERWIDTH ;
dmPaperWidth:=2130;//Trunc(2130/254*PixelsInInchX);
dmFields:=dmFields or DM_PAPERLENGTH ;
dmPaperLength:=1019;//Trunc(1020/254*PixelsInInchY);
end;
finally
GlobalUnLock(DeviceHandle);
end;
Result:=True;
end;