?
Solved

How to change windows default printer (delphi 1.0)

Posted on 1997-07-15
7
Medium Priority
?
473 Views
Last Modified: 2010-04-06
How to change windows default printer via delphi 1.0?
0
Comment
Question by:olmy
[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
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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

719 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