Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Koen Piller
  Where is Koen Piller?
 Santpoort-Zuid
 Netherlands
 Koen Piller
 Tags
Subject: RE: default printer
Thread ID: 123407 Message ID: 123498 # Views: 48 # Ratings: 1
Version: Visual FoxPro 9 Category: Reports and Printers
Date: Monday, February 26, 2007 9:57:15 AM         
   


> Hi,
>
> I am looking for a function to tell me the name and/or location of the default installed printer on the enduser pc. Any VFP or API call for this?
> Thanks,
> Koen

If you want to use API:
DECLARE INTEGER GetDefaultPrinter IN winspool.drv STRING @ cBuffer, INTEGER @ nBuffer 

cPrinter = space(1024)
nPrtBuffer = 0

?GetDefaultPrinter( @cPrinter, @nPrtBuffer)

*The other way around is to use SetDefaultPrinter()

DECLARE Integer SetDefaultPrinter in winspool.drv STRING cPrintername
?SetDefaultPrinter( getprinter() )


HTH

Boudewijn LutgeĀ®ink
http://www.vfpdevelopers-online.com
The attitude of "An eye for an eye and a tooth for a tooth" will make this world toothless and blind (Gandhi)

COMPLETE THREAD

default printer Posted by Koen Piller @ 2/25/2007 12:05:07 AM
RE: default printer Posted by Dragan Nedeljkovich @ 2/25/2007 12:39:47 AM
RE: default printer Posted by Koen Piller @ 2/25/2007 4:51:08 PM
RE: default printer Posted by Robby Samson @ 2/26/2007 2:46:55 AM
RE: default printer Posted by Dragan Nedeljkovich @ 3/11/2007 8:32:45 PM
RE: default printer Posted by Boudewijn Lutgerink @ 2/26/2007 9:57:15 AM
RE: default printer Posted by Koen Piller @ 3/1/2007 12:03:50 AM
RE: default printer Posted by Boudewijn Lutgerink @ 3/2/2007 12:18:34 AM