如何利用printdialog,把选好的打印机作为quickreport的默认打印机?谢谢。
解决方案 »
- Ehlib3.4+Delphi6,导入Execl的函数怎么没反应啊,具体请看正文,谢谢!
- Tab键转化为enter浆
- 请教 哪位老大知道Dephi7下的Gif动画控件
- UDP包发送的问题
- 一个读取最大值的问题(Delphi+Ado+Oracle)在线等候
- 关于声音输入的问题……
- 高价出售PB、DELPHI、VB程序
- 郁闷!!!!!!!!!!!!!!不知咋回事高手请进!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 谁有解版的ReportBuilder?急需
- !!!请问如何遍历DELPHI类中的所有私有属性?或着遍历一个记录中的所有成员?!!请高手指点,不胜感激!!!!!!!
- 老大!!求助呀!!帮帮小弟吧
- 欢迎大家访问我的小站:http://wgqsoft.533.net
procedure TForm1.Button1Click(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
//messagebeep(2);
beep();
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));
ComboBox1.Items := Printer.Printers; {populates ComboBox}
ComboBox1.ItemIndex := Printer.PrinterIndex;
end;procedure TForm1.ComboBox1Change(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;