Solved

Printer Drivers

Posted on 2001-06-03
2
223 Views
Last Modified: 2010-04-06
is it posisble to right printer drivers in delphi? If so how can I go about it

thanks
0
Comment
Question by:colonna_mike
2 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 25 total points
ID: 6151405
no i believe its not possible,you need visualc++ etc for that..
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6151512
I'm not so sure that I have understood your question , but ...

uses WinSpool;

procedure TForm1.FormCreate(Sender: TObject);
begin
   comboPrinters.Items.Assign( Printer.Printers );
end;


procedure TForm1.Button1Click(Sender: TObject);
var
    hPrinter: THandle;
    PrtName: String;
    DriverInfo: PDriverInfo2;
    dwNeeded: DWord;
begin
    PrtName :=  comboPrinters.Text;
    OpenPrinter( PChar( PrtName ) , hPrinter , nil );
    GetPrinterDriver( hPrinter, nil, 2, DriverInfo, 0, dwNeeded );
    GetMem( DriverInfo, dwNeeded );
    if GetPrinterDriver( hPrinter, nil, 2, DriverInfo, dwNeeded, dwNeeded )
then
    begin
       Memo1.Lines.Add( IntToStr( DriverInfo.cVersion ) );  // The driver
version
       Memo1.Lines.Add( StrPas( DriverInfo.pName ) );
       Memo1.Lines.Add( StrPas( DriverInfo.pEnvironment ) );
       Memo1.Lines.Add( StrPas( DriverInfo.pDriverPath ) );
       Memo1.Lines.Add( StrPas( DriverInfo.pDataFile ) );
       Memo1.Lines.Add( StrPas( DriverInfo.pConfigFile ) );
    end
    else
        Memo1.Lines.Add( 'No Info needed = ' + IntToStr( dwNeeded ) );
    ClosePrinter( hPrinter );
    FreeMem( DriverInfo );
end;
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now