var fdevicechar;<br> fdriverchar;<br> fportchar;<br> fhandle:thandle;<br> currentprintername:string;<br>begin<br> getmem(fdevice,255);<br> getmem(fdriver,255);<br> getmem(fport,255);<br> printer.getprinter(fdevice,fdriver,fport,fhandle);<br> currentprintername:=fdevice;<br> if fdevice<>nil then freemem(fdevice,255);<br> if fdriver<>nil then freemem(fdriver,255);<br> if fport<>nil then freemem(fport,255);<br> if currentprintername='' then <br> messagedlg('你尚未安装打印机驱动程序。',mterror,[mbok],0);<br>end;