Delphi實現(xiàn)檢測并枚舉系統(tǒng)安裝的打印機的方法
更新時間:2014年07月29日 09:27:56 投稿:shichen2014
這篇文章主要介紹了Delphi實現(xiàn)檢測并枚舉系統(tǒng)安裝的打印機的方法,需要的朋友可以參考下
本文以實例說明Delphi打印程序的實現(xiàn)方法。該實例可以檢測系統(tǒng)中安裝的所有打印機,枚舉出這些打印機,主要功能代碼非常簡單,便于大家閱讀與理解。
主要功能代碼如下:
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('沒有安裝打印機!');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Close;
end;
end.
您可能感興趣的文章:
- delphi7連接mysql5的實現(xiàn)方法
- delphi mysql adbquery數(shù)據(jù)提供程序或其他服務返回 E_FAIL 狀態(tài)
- Delphi創(chuàng)建開機啟動項的方法示例
- Delphi編程常用快捷鍵大全
- Delphi實現(xiàn)獲取句柄并發(fā)送消息的方法
- Delphi實現(xiàn)木馬文件傳輸代碼實例
- Delphi實現(xiàn)木馬自我拷貝方法
- Delphi實現(xiàn)窗口文字淡入淡出漸變效果的方法
- Delphi實現(xiàn)獲取磁盤空間大小的方法
- Delphi實現(xiàn)圖像文本旋轉特效完整實例代碼
- Delphi常用關鍵字用法詳解
- Delphi中對時間操作方法匯總
- Delphi遠程連接Mysql的實現(xiàn)方法
相關文章
Delphi實現(xiàn)Listbox中的item根據(jù)內容顯示不同顏色的方法
這篇文章主要介紹了Delphi實現(xiàn)Listbox中的item根據(jù)內容顯示不同顏色的方法,需要的朋友可以參考下2014-07-07
Java中CountDownLatch和CyclicBarrier的區(qū)別與詳解
CountDownLatch和CyclicBarrier是Java并發(fā)包提供的兩個非常易用的線程同步工具類,本文主要介紹了Java中CountDownLatch和CyclicBarrier的區(qū)別與詳解,具有一定的參考價值,感興趣的可以了解一下2023-11-11

