Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to change windows default printer (delphi 1.0)

Posted on 1997-07-15
7
Medium Priority
?
489 Views
Last Modified: 2010-04-06
How to change windows default printer via delphi 1.0?
0
Comment
Question by:olmy
7 Comments
 
LVL 1

Expert Comment

by:Zonnald
ID: 1338922
Olmy,

In the system components area there is a Printer Dialog which gives access to all the expected Printer options/settings just add the component to one of your forms and then attach some code to a button to execute the printer dialog.

Now if you require to preform a programmatic change to the default printer - that may be a little more difficult than 50 points would indicate.
0
 
LVL 1

Expert Comment

by:Zonnald
ID: 1338923
Actually,

I have found another answer to an earlier similar question that may help - it talks about changing the default printer in win31 and refers to WIN API's.

Feel free to have a look at that answer and reject mine if you wish.

Zonnald
0
 
LVL 1

Author Comment

by:olmy
ID: 1338924
Sorry it took so long. There was something wrong with this system -> I could not grade your answer
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
Chova earned 100 total points
ID: 1338925
Hi,
I think that you must use the TPrinter object.
Because, you can use :
 * GetPrinter  to know the list of the Windows printer actually    
   installed.
 * SetPrinter to assign the printer that you want used.
 For more information, look at the Delphi help file on
TPrinter unit and CreateDC in WIN32 API Help File.

Regards,

Stéphane



0
 
LVL 1

Author Comment

by:olmy
ID: 1338926
Hi Chova

Are you sure that SetPrinter changes windows default printer?

In online saids "You should seldom, if ever, need to call this method, but instead should access the printer you want in the Printers property array" <- And with Printers property array you can't change the default printer of windows, only the default printer in your own program.
0
 
LVL 4

Expert Comment

by:itamar
ID: 1338927
Hi people,
perhaps the Registry could be a good direction to work on it ?
0
 
LVL 1

Author Comment

by:olmy
ID: 1338928
OK, lets try that.
Comment for "itamar" this should work in windows 3.x also.
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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

972 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