Solved

How to change windows default printer (delphi 1.0)

Posted on 1997-07-15
7
417 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Accepted Solution

by:
Chova earned 50 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 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

23 Experts available now in Live!

Get 1:1 Help Now