如何改变WINDOWS打印机的默认设置

nternter 2003-10-15 05:51:55
如何改变WINDOWS打印机的默认设置,我想改变打印机的默认设置为'横向'
...全文
176 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
fukcsdn 2004-01-10
  • 打赏
  • 举报
回复
收邮件
noil0125 2003-10-20
  • 打赏
  • 举报
回复
再up
noil0125 2003-10-18
  • 打赏
  • 举报
回复
up
waysoft 2003-10-18
  • 打赏
  • 举报
回复
up
birdhzx 2003-10-18
  • 打赏
  • 举报
回复
哦,急忙中发现看错了,以为你要改变默认打印机,结果你要改'默认打印机设置',呵呵,我闪了
用api试试...
birdhzx 2003-10-18
  • 打赏
  • 举报
回复
procedure TFrmPrint.cbPrintersChange(Sender: TObject);
var
IniFile: TIniFile;
TempStr1, TempStr2: String;
S: array[0..64] of char;
begin
with Printer do
begin
// Set the new printer based on the ComboBox's selected printer
PrinterIndex := cbPrinters.ItemIndex;
// Store the printer name into a temporary string
TempStr1 := Printers[PrinterIndex];
// Delete the unnecessary portion of the printer name
System.Delete(TempStr1, Pos(' on ', TempStr1), Length(TempStr1));
// Create a TIniFile class
IniFile := TIniFile.Create('WIN.INI');
try
// Retrieve the device name of the selected printer
TempStr2 := IniFile.ReadString('Devices', TempStr1, '');
// Change the default printer to that chosen by the user
IniFile.WriteString('windows', 'device', TempStr1 + ',' + TempStr2);
// Tell all windows that the default printer changed.
StrCopy(S, 'windows');
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, LongInt(@S));
finally
IniFile.Free;
end;
end;

end;
我自己用了,可以实现.
朋友,有quickreport的打印demo吗,给个啦........急阿...
nternter 2003-10-17
  • 打赏
  • 举报
回复
noil0125 2003-10-17
  • 打赏
  • 举报
回复
再顶
noil0125 2003-10-16
  • 打赏
  • 举报
回复
学习
nternter 2003-10-16
  • 打赏
  • 举报
回复
哪位高手帮个忙啊!
nternter 2003-10-15
  • 打赏
  • 举报
回复
我是要改系统的默认啊,我要改了一次以后,下次其它程序(网页)来打印时,弹出的打印对话框也是默认'横向'的.
有办法吗,是通过修改注册表吗?
soldier7451 2003-10-15
  • 打赏
  • 举报
回复
dialog面板的printsetupdialog组件里就可以修改啊

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧