Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printer Drivers

Posted on 2001-06-03
2
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 75 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

705 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