Delphi實(shí)現(xiàn)檢測并枚舉系統(tǒng)安裝的打印機(jī)的方法
更新時(shí)間:2014年07月29日 09:27:56 投稿:shichen2014
這篇文章主要介紹了Delphi實(shí)現(xiàn)檢測并枚舉系統(tǒng)安裝的打印機(jī)的方法,需要的朋友可以參考下
本文以實(shí)例說明Delphi打印程序的實(shí)現(xiàn)方法。該實(shí)例可以檢測系統(tǒng)中安裝的所有打印機(jī),枚舉出這些打印機(jī),主要功能代碼非常簡單,便于大家閱讀與理解。
主要功能代碼如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Printers, XPMan;
type
TForm1 = class(TForm)
Button1: TButton;
GroupBox1: TGroupBox;
Memo1: TMemo;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Clear;
memo1.Lines.Assign(Printer.Printers);
if trim(memo1.Text) = '' then
begin
showmessage('沒有安裝打印機(jī)!');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Close;
end;
end.
您可能感興趣的文章:
- delphi7連接mysql5的實(shí)現(xiàn)方法
- delphi mysql adbquery數(shù)據(jù)提供程序或其他服務(wù)返回 E_FAIL 狀態(tài)
- Delphi創(chuàng)建開機(jī)啟動項(xiàng)的方法示例
- Delphi編程常用快捷鍵大全
- Delphi實(shí)現(xiàn)獲取句柄并發(fā)送消息的方法
- Delphi實(shí)現(xiàn)木馬文件傳輸代碼實(shí)例
- Delphi實(shí)現(xiàn)木馬自我拷貝方法
- Delphi實(shí)現(xiàn)窗口文字淡入淡出漸變效果的方法
- Delphi實(shí)現(xiàn)獲取磁盤空間大小的方法
- Delphi實(shí)現(xiàn)圖像文本旋轉(zhuǎn)特效完整實(shí)例代碼
- Delphi常用關(guān)鍵字用法詳解
- Delphi中對時(shí)間操作方法匯總
- Delphi遠(yuǎn)程連接Mysql的實(shí)現(xiàn)方法
相關(guān)文章
wordpress主題支持自定義菜單及修改css樣式實(shí)現(xiàn)方法
使用wordpress過程中會遇到主題支持自定義菜單以及修改css樣式問題,本文將介紹詳細(xì)解決方法,需要朋友可以參考下2012-12-12
delphi mysql adbquery數(shù)據(jù)提供程序或其他服務(wù)返回 E_FAIL 狀態(tài)
這篇文章主要介紹了delphi mysql adbquery數(shù)據(jù)提供程序或其他服務(wù)返回 E_FAIL 狀態(tài)的解決方法2013-11-11

