BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Programatically setting Windows default printer

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
Alexander Bauer
Guest





PostPosted: Sun Aug 10, 2003 2:40 pm    Post subject: Re: Programatically setting Windows default printer Reply with quote



Hi,

Try the WinAPI SetDefaultPrinter. It takes the printer name as input
parameter.
The SetDefaultPrinter function sets the printer name of the default printer
for the current user on the local computer.

BOOL SetDefaultPrinter(
LPCTSTR pszPrinter // default printer name
);

I think that's what you are looking for. See the MS Platform SDK for more
information ("Printing and Print Spooler Functions", "Printing and Print
Spooler Reference"). It's available online at
http://msdn.microsoft.com/library/default.asp.

Regards,
Alexander Bauer


"Rhonda Rhames" <rdrhames (AT) comcast (DOT) net> schrieb im Newsbeitrag
news:3f35ad9c$1 (AT) newsgroups (DOT) borland.com...
Quote:
I need to construct a simple component that will progamatically set the
Windows Default Printer (for any/all print jobs) to specified printer,
without user selection. What is the easiest way to accomplish that?





Back to top
Yorai Aminov (TeamB)
Guest





PostPosted: Sun Aug 10, 2003 4:00 pm    Post subject: Re: Programatically setting Windows default printer Reply with quote



Multi-posted and answered elsewhere. Please do not multi-post
messages. For more information, see the newsgroups guidelines at
http://info.borland.com/newsgroups/guide.html.

---
Yorai Aminov (TeamB)
http://develop.shorterpath.com/yorai
(TeamB cannot answer questions received via email.)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.