Re: Accessing the default printer

new topic     » goto parent     » topic index » view thread      » older message » newer message

CChris wrote:
> 
> Andy Drummond wrote:
> > 
> > Greg Haberek wrote:
> > > 
> > > Try this:
> > > 
> > > <a
> > > href="http://www.freewebtown.com/ghaberek/getDefaultPrinter.ew">http://www.freewebtown.com/ghaberek/getDefaultPrinter.ew</a>
> > > 
> > > I wrote this a back in March and was planning to submit it to
> > > Win32Lib. It should probably be included, as it is quite useful. :)
> > > 
> > > -Greg
> > > 
> > > On 10/23/07, don cole <guest at rapideuphoria.com> wrote:
> > > >
> > > >
> > > > posted by: don cole <doncole at p?cbell.n?t>
> > > >
> > > >
> > > > hello again Andy,
> > > >
> > > > Also see getPrintChoice()
> > > >
> > > > Don Cole
> > > >
> > > >
> > Great!  thank you, Greg & Don. This is precisely what I wanted. So - CChris,
> > how about adding this to the printing section of the Win32Lib next issue?
> > I will try it soon and come back if I have problems; I don't think I will.
> > 
> > AndyD
> 
> There's already some code in 70.1 that checks for what the current printer is.
> I'll check Greg's program and merge it shortly.
> 
> CChris

v70.1 already defines getPrinterName(), which returns the name of current
printer.

I'll add this:
--/topic Printing
--/func getDefaultPrinter()
--/desc Like /getPrinter(), but assumes there is a default printer already
installed.
--/ret (ATOM) DC for default printer.
global function getDefaultPrinter()
    printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
    return printerDC
end function

pname holds the string getPrinterName() returns, and wsp holds "WINSPOOL").

CChris
NOTE: Derek, you have a lock on win32lib.ew, so that I can't update it in 70.2
using SVN. I didn't attempt to break the lock.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu