怎样得到印表机打印的内容? |
|
tonny2003
一般會員 發表:5 回覆:2 積分:1 註冊:2005-09-13 發送簡訊給我 |
|
bbawei
一般會員 發表:0 回覆:2 積分:0 註冊:2006-11-24 發送簡訊給我 |
|
susu
一般會員 發表:0 回覆:6 積分:11 註冊:2004-07-19 發送簡訊給我 |
type
TPrinterInfo = record SeverName : PChar; PrinterName : PChar; ShareName : PChar; PortName : PChar; DriverName : PChar; Comment : PChar; Location : PChar; DeviceMode : PDeviceModeA; SepFile : PChar; PrintProcessor : PChar; DataType : PChar; Parameters : PChar; SecurityDescriptor: PSecurityDescriptor; Attributes : Cardinal; DefaultPriority : Cardinal; StartTime : Cardinal; UntilTime : Cardinal; Status : Cardinal; Jobs : Cardinal; AveragePPM : Cardinal; end; function GetCurrentPrinterInformation: TPrinterInfo; var hPrinter : THandle; pInfo: PPrinterInfo2; bytesNeeded: DWORD; begin hprinter := GetCurrentPrinterHandle; try Winspool.GetPrinter( hPrinter, 2, Nil, 0, @bytesNeeded ); pInfo := AllocMem( bytesNeeded ); try Winspool.GetPrinter( hPrinter, 2, pInfo, bytesNeeded, @bytesNeeded ); Result.SeverName := pInfo^.pServerName; Result.PrinterName := pInfo^.pPrinterName; Result.ShareName := pInfo^.pShareName; Result.PortName := pInfo^.pPortName; Result.DriverName := pInfo^.pDriverName; Result.Comment := pInfo^.pComment; Result.Location := pInfo^.pLocation; Result.DeviceMode := pInfo^.pDevMode; Result.SepFile := pInfo^.pSepFile; Result.PrintProcessor := pInfo^.pPrintProcessor; Result.DataType := pInfo^.pDatatype; Result.Parameters := pInfo^.pParameters; Result.SecurityDescriptor := pInfo^.pSecurityDescriptor; Result.Attributes := pInfo^.Attributes; Result.DefaultPriority := pInfo^.DefaultPriority; Result.StartTime := pInfo^.StartTime; Result.UntilTime := pInfo^.UntilTime; Result.Status := pInfo^.Status; Result.Jobs := pInfo^.cJobs; Result.AveragePPM := pInfo^.AveragePPM; finally FreeMem( pInfo ); end; finally ClosePrinter( hPrinter ); end; end; |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |