Solved

How to change windows default printer (delphi 1.0)

Posted on 1997-07-15
7
422 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtualstringtree carsh after invalidate for while 5 86
Delphi OLE Error 8 93
JAudiorecorder record freezing the app 29 59
Firemonkey webbrowser scrollbars ? 1 29
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
A short film showing how OnPage and Connectwise integration works.

919 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

14 Experts available now in Live!

Get 1:1 Help Now