用DocumentProperties显示打印机属性对话框 (300分)

  • 主题发起人 主题发起人 killgates
  • 开始时间 开始时间
K

killgates

Unregistered / Unconfirmed
GUEST, unregistred user!
do
cumentProperties(Handle, HPrt, FDevice, DevMode^,DevMode^, DM_IN_PROMPT);
对话框出不来啊
 
全部代码
procedure TdlgPrint.bPropertyClick(Sender: TObject);
var
FHandle:THandle;
HPrt:THandle;
FDevice:array[0..255] of char;
FDriver:array[0..255] of char;
FPort:array[0..255] of char;
DeviceMode: THandle;
DevMode: PDeviceMode;
begin
FHandle:=0;
HPrt:=0;
Printer.GetPrinter(FDevice, FDriver, FPort, FHandle);
OpenPrinter(FDevice, HPrt, nil);
DeviceMode := GlobalAlloc(GHND,
do
cumentProperties(0, HPrt, FDevice, DevMode^,
DevMode^, 0));
if DeviceMode <> 0 then
begin
DevMode := GlobalLock(DeviceMode);
ifdo
cumentProperties(0, HPrt, FDevice, DevMode^,
DevMode^, DM_PROMPT) < 0 then
begin
GlobalUnlock(DeviceMode);
GlobalFree(DeviceMode);
DeviceMode := 0;
end;
end;
ClosePrinter(hPrt);
end;
 
靠,3年前的帖子居然没人进来,问题我早就解决了,散分。
 
搞定了
 
能公布一下代码吗?
 
FDevice, FDriver, FPort:array [0..255] of char;
DeviceMode,HPrt:THandle;
DevMode:PDeviceMode;
Printer.GetPrinter(FDevice, FDriver, FPort, DeviceMode);
OpenPrinter(FDevice, HPrt, nil);
DevMode :=GlobalLock( DeviceMode);
...
ifdo
cumentProperties(Self.Handle,HPrt,FDevice,DevMode^,DevMode^,DM_MODIFY or DM_PROMPT or DM_OUT_BUFFER)=idok then
begin
do
cumentProperties(0,HPrt,FDevice,DevMode^,DevMode^,DM_IN_BUFFER);
end;
...
 
接受答案了.
 

Similar threads

D
回复
0
查看
824
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
669
DelphiTeacher的专栏
D
后退
顶部