Delphi實(shí)現(xiàn)檢測(cè)并枚舉系統(tǒng)安裝的打印機(jī)的方法
更新時(shí)間:2014年07月29日 09:27:56 投稿:shichen2014
這篇文章主要介紹了Delphi實(shí)現(xiàn)檢測(cè)并枚舉系統(tǒng)安裝的打印機(jī)的方法,需要的朋友可以參考下
本文以實(shí)例說(shuō)明Delphi打印程序的實(shí)現(xiàn)方法。該實(shí)例可以檢測(cè)系統(tǒng)中安裝的所有打印機(jī),枚舉出這些打印機(jī),主要功能代碼非常簡(jiǎn)單,便于大家閱讀與理解。
主要功能代碼如下:
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('沒(méi)有安裝打印機(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)建開(kāi)機(jī)啟動(dòng)項(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中對(duì)時(shí)間操作方法匯總
- Delphi遠(yuǎn)程連接Mysql的實(shí)現(xiàn)方法
相關(guān)文章
Delphi實(shí)現(xiàn)Listbox中的item根據(jù)內(nèi)容顯示不同顏色的方法
這篇文章主要介紹了Delphi實(shí)現(xiàn)Listbox中的item根據(jù)內(nèi)容顯示不同顏色的方法,需要的朋友可以參考下2014-07-07Delphi 實(shí)現(xiàn)軟件自動(dòng)升級(jí)的功能
這篇文章主要介紹了Delphi 實(shí)現(xiàn)軟件自動(dòng)升級(jí)的功能的相關(guān)資料,希望通過(guò)本文能幫助到大家實(shí)現(xiàn)這樣的功能,需要的朋友可以參考下2017-09-09Java中CountDownLatch和CyclicBarrier的區(qū)別與詳解
CountDownLatch和CyclicBarrier是Java并發(fā)包提供的兩個(gè)非常易用的線程同步工具類,本文主要介紹了Java中CountDownLatch和CyclicBarrier的區(qū)別與詳解,具有一定的參考價(jià)值,感興趣的可以了解一下2023-11-11