如何将特定的内容用特定的打印机打印?? 我有一些不同的表报,计算机上安装了两个打印机:一个本地打印机,一个网络打印机。我的不用表报要有不同的打印机打印,请问用程序如何实现(不用打印设置对话框选择)??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我认为,你先判断该用什么打印机打,然后更改默认打印机是不是可以?uses printers;procedure TForm1.Button1Click(Sender: TObject);begin ComboBox1.Items := Printer.Printers; ComboBox1.ItemIndex := Printer.PrinterIndex; end;procedure TForm1.Button2Click(Sender: TObject);var Device: array[0..255] of Char; Driver: array[0..255] of char; Port: array[0..255] of char; s : array[0..255] of Char; hDeviceMode: THandle;begin Printer.PrinterIndex := ComboBox1.ItemIndex; Printer.GetPrinter (Device, Driver, Port, hDeviceMode); StrCopy (s, Device); StrCat (s, ','); StrCat (s, Driver); StrCat (s, ','); StrCat (s, Port); WriteProfileString ('windows', 'device', s); StrCopy (s, 'windows'); SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, LongInt(@s));end; 多谢你的意见,ruhapy(风)!可是我打印的是rave报表,在程序运行中改变肋默认打印机,打印报表不会自动选用默认打印机!不知你对rave熟不熟悉,请帮忙! 在线等,判断一个单元是否在 uses列表中??? 如何远程修改服务器IP 这个动态库怎么做? treeView 所选择过的内容如何显示在COMBOBOX中 请问"年龄"怎么求? 怎么解决provider not find错误? 按键编程的问题请教下 CSDN怎么加不成分了?我都试了3、4遍了,迷茫中........ 如何过滤整形字段? 有QQ2000的发送消息和接收消息的接口协议?400分 用socketconnection制作的三层..... 我要登陆到2000 SERVER上怎么做才能不弹出要我输入用户名和密码对话框
uses printers;procedure TForm1.Button1Click(Sender: TObject);
begin
ComboBox1.Items := Printer.Printers;
ComboBox1.ItemIndex := Printer.PrinterIndex;
end;procedure TForm1.Button2Click(Sender: TObject);
var
Device: array[0..255] of Char;
Driver: array[0..255] of char;
Port: array[0..255] of char;
s : array[0..255] of Char;
hDeviceMode: THandle;
begin
Printer.PrinterIndex := ComboBox1.ItemIndex;
Printer.GetPrinter (Device, Driver, Port, hDeviceMode);
StrCopy (s, Device);
StrCat (s, ',');
StrCat (s, Driver);
StrCat (s, ',');
StrCat (s, Port);
WriteProfileString ('windows', 'device', s);
StrCopy (s, 'windows');
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, LongInt(@s));
end;
可是我打印的是rave报表,在程序运行中改变肋默认打印机,打印报表不会自动选用默认打印机!不知你对rave熟不熟悉,请帮忙!