Solved

Printer Drivers

Posted on 2001-06-03
2
226 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 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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month6 days, 2 hours left to enroll

626 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